admin管理员组文章数量:1024933
I m actually studying continuous integration and I m actually facing a (little) problem when dealing with the build sequence of the process.
Actually, I have an application that has the following directory at the root of the project:
- src
- doc
- dist
- tests
- node_modules
My question is : when I m at the building step (building the last artifact to put in production, after testing process) should I copy the node_modules directory inside of the dist folder ? So this dist folder could work in standalone (with minification etc... etc...) and so I have only to deploy this folder in my prod environnement ?
How can I move only "dependencies" modules and not "devDependencies" modules ?
I m actually studying continuous integration and I m actually facing a (little) problem when dealing with the build sequence of the process.
Actually, I have an application that has the following directory at the root of the project:
- src
- doc
- dist
- tests
- node_modules
My question is : when I m at the building step (building the last artifact to put in production, after testing process) should I copy the node_modules directory inside of the dist folder ? So this dist folder could work in standalone (with minification etc... etc...) and so I have only to deploy this folder in my prod environnement ?
How can I move only "dependencies" modules and not "devDependencies" modules ?
Share Improve this question asked Oct 17, 2015 at 9:12 Thomas thomasThomas thomas 7952 gold badges9 silver badges19 bronze badges 1- Is this a server-side Node.js application or a client application (just using node_modules as dependencies)? I am not sure if minification is even necessary for a server-side Node.js application... – Nitax Commented Mar 3, 2016 at 22:45
1 Answer
Reset to default 3You don't need to copy anything, because Node when you require
a module within your Node app, it will search for node_modules
in current directory, and if the dependency is not found, it will try to search in its parent and so on.
Check out how Node looks for a package here: http://mycodesmells./post/node-basics-looking-for-package/
If you don't want to have development dependencies in your production environment, you can install only non-dev ones:
npm install --production
Source: https://docs.npmjs./cli/install
I m actually studying continuous integration and I m actually facing a (little) problem when dealing with the build sequence of the process.
Actually, I have an application that has the following directory at the root of the project:
- src
- doc
- dist
- tests
- node_modules
My question is : when I m at the building step (building the last artifact to put in production, after testing process) should I copy the node_modules directory inside of the dist folder ? So this dist folder could work in standalone (with minification etc... etc...) and so I have only to deploy this folder in my prod environnement ?
How can I move only "dependencies" modules and not "devDependencies" modules ?
I m actually studying continuous integration and I m actually facing a (little) problem when dealing with the build sequence of the process.
Actually, I have an application that has the following directory at the root of the project:
- src
- doc
- dist
- tests
- node_modules
My question is : when I m at the building step (building the last artifact to put in production, after testing process) should I copy the node_modules directory inside of the dist folder ? So this dist folder could work in standalone (with minification etc... etc...) and so I have only to deploy this folder in my prod environnement ?
How can I move only "dependencies" modules and not "devDependencies" modules ?
Share Improve this question asked Oct 17, 2015 at 9:12 Thomas thomasThomas thomas 7952 gold badges9 silver badges19 bronze badges 1- Is this a server-side Node.js application or a client application (just using node_modules as dependencies)? I am not sure if minification is even necessary for a server-side Node.js application... – Nitax Commented Mar 3, 2016 at 22:45
1 Answer
Reset to default 3You don't need to copy anything, because Node when you require
a module within your Node app, it will search for node_modules
in current directory, and if the dependency is not found, it will try to search in its parent and so on.
Check out how Node looks for a package here: http://mycodesmells./post/node-basics-looking-for-package/
If you don't want to have development dependencies in your production environment, you can install only non-dev ones:
npm install --production
Source: https://docs.npmjs./cli/install
本文标签: javascriptContinuous integrationdist folder and nodemodulesStack Overflow
版权声明:本文标题:javascript - Continuous integration, dist folder and node_modules - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745500253a2153357.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论