Regarding using node to generate a package.json configuration file, does it cause a problem for the development environment and production environment inside?
Some explanations from the Internet said that we need some dependencies during development, but they are not needed during production (product launch),
So if we use webpack, we can not package these dependencies.
Then the question is, what dependencies do not need to be packaged?
For example, those dependencies that cause code errors, I can understand this, but why are some conversions such as babel
, css-loader
, style-loader
Are the dependencies not packaged?
If they are not packaged, when we use webpack to package them, they are not converted into something that the browser can recognize, then it won’t work?
仅有的幸福2017-05-16 13:47:42
Your so-called babel
(编译js
),css-loader
(编译css
)这些的东西,早都在你build
的时候编译好了,而打包所做的是兼容amd
cmd
CommonJs
和 es6 module
specification integrates js files imported from different specifications, which will not cause any problems that cannot be recognized by the production environment.