icon-cookie
The website uses cookies to optimize your user experience. Using this website grants us the permission to collect certain information essential to the provision of our services to you, but you may change the cookie settings within your browser any time you wish. Learn more
I agree
blank_error__heading
blank_error__body
Text direction?

和Grunt.js、Gulp.js的区别

没有比较性

Gulp/Grunt是一种能够优化前端的开发流程的自动化工具,webpack是模块化的解决方案,本质上就不是一样,而且在很多时候,webpack可以替代前面两者的工作

webpack是webpack自带的一条打包命令,是最基本的打包命令。
npm run webpack,则是在package.json文件中有一个script配置项,在这个script里面自定义的一条命令,它通过npm来运行。例如:

"scripts": {
    "start": "webpack",
    "server": "webpack-dev-server --open",
    "build": "set NODE_ENV=production && webpack --config ./webpack.production.config.js --progress"
  },

当脚本名为“start”时,可以省略“run”,直接为:

npm start

npm run server等也类似

有兴趣可以加入Nodejs交流群,和大佬们一起成长!!!

群号:348108867

图片.png
Measure
Measure
Related Notes
Get a free MyMarkup account to save this article and view it later on any device.
Create account

End User License Agreement

Summary | 1 Annotation
webpack可以看做是模块打包机,分析项目结构,找到JavaScript模块和一些浏览器不能直接运行的语言,类似Scss,JSX,Typescript等,并将其转换和打包为合适的格式供浏览器使用
2020/06/02 07:11