Closed TintypeMolly closed 7 years ago
찾아보니 NPM 3.0 마일스톤으로 Dependencies와 devDependencies 폴더를 다르게 지정하는 기능이 이슈에 올라와 있습니다. (https://github.com/npm/npm/issues/9674)
현재는 빌드시에 둘을 구분할 수 있는 방법이 딱히 없는 바, 위에 제시된 대로 build 폴더 안에 프로젝트를 복사하고 npm install하는 방법이 제일 좋은것 같습니다.
타 프로젝트들을 보면 build:win32 build:darwin과 같이 어떤 것을 빌드할 것인지 넘길 수 있는데 이걸 추가하면 될것같구요.
I'm working on this
Maybe we can exclude unnecessary dev-dependencies from build to shrink the sizes of dists.
npm prune --production
might do the job, but we still needelectron-packager
.And
electron
is ondevDependencies
right now,but I think it should be moved to
dependencies
.Basic Build Procedure Idea
Assumptions
/build
directory is not used to place distribution files anymore. It will be used as a temporary storage for intermediate files during the build./dist
will be used to place distribution files. This directory should be ignored.node_modules
have bothdependencies
anddevDependencies
installed.Procedures
/build
directory except thenode_modules
directorynpm install --production
inside the build directory/build
'snode_modules
have onlydependencies
notdevDependencies
./build
using the project root's environment whichelectron-packager
installed.Possible Improvements
arch
andplatform
by passing arguments likeelectron-packager
binary, it would be nice.