search

Home  >  Q&A  >  body text

node.js - Problem with development environment and production environment in package.json?

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?

世界只因有你世界只因有你2749 days ago809

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 13:47:42

    Your so-called babel(编译js),css-loader(编译css)这些的东西,早都在你build的时候编译好了,而打包所做的是兼容amd cmd CommonJses6 module specification integrates js files imported from different specifications, which will not cause any problems that cannot be recognized by the production environment.

    reply
    0
  • Cancelreply