如果我只想包含特定路径,如何精简./src
?
我的存储库中有./dist
和./dist
个文件。我想有效地仅发布./package.json
+ .npmignore
。
使用./src
忽略./src
只会忽略./dist
文件夹。我想只包含require('my-package/dist/something')
的内容,即现在用户需要require('my-package/something')
。我想把它./something
。 ./dist
中包含npm run build
cp package.json ./dist
# or, if you need to have package.json "main" entry different,
# e.g. for being able to use `npm link`, you need to replace "main" value:
# sed 's#"main": "./dist/index.js"#"main": "./index.js"#' package.json > ./dist/package.json
cd ./dist
npm publish
。
答案 0 :(得分:4)
我现在的方式是,我创建了一个bash脚本:
m1 <- matrix(c(1,2,1,6,3,7,4,2,6,8,11,15), ncol=4, byrow = TRUE)
# expected outcome, given a range of +/-1 either side
exp.outcome<-matrix(c(TRUE,TRUE,TRUE,FALSE,
TRUE,FALSE,TRUE,TRUE,
FALSE,FALSE,FALSE,FALSE),
ncol=4, byrow=TRUE)
答案 1 :(得分:0)
为了跨平台兼容性,请使用 shx:
npm run build
shx cp package.json ./dist
shx cd ./dist
npm publish