I would like to publish a npm package that contains my source as well as distribution files. My Github repository contains src
folder which contains JavaScript source files. The build process generates dist
folder that contains the distribution files. Of course, the dist
folder is not checked into the Github repository.
How do I publish a npm package in a way that when someone does npm install
, they get src
as well as dist
folder? Currently when I run npm publish
from my git repository, it results in only src
folder being published.
My package.json looks like this:
{
"name": "join-js",
"version": "0.0.1",
"homepage": "https://github.com/archfirst/joinjs",
"repository": {
"type": "git",
"url": "https://github.com/archfirst/joinjs.git"
},
"main": "dist/index.js",
"scripts": {
"test": "gulp",
"build": "gulp build",
"prepublish": "npm run build"
},
"dependencies": {
...
},
"devDependencies": {
...
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…