Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
592 views
in Technique[技术] by (71.8m points)

npm或者yarn安装的时候我没有-D,最后打包的时候,开发环境的依赖会被打包吗?

如题:安装依赖的时候如果我不主动区分生产环境依赖包和开发环境依赖包,依赖信息会默认存在dependencies,那build时候会把dependencies字段里所有的依赖打包吗?如果是,react官网安装typescript时候为什么不加-D如果不是pageage.json中区分dependenciesdevDependencies有什么意义?
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

昨天刚回答完同样的问题……

传送门:https://ostack.cn/q/1010000024479756/a-1020000024480877


太长不看版:对于三大框架这种需要 Bundle 才能运行的项目来说,放哪其实都一样


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...