The vue official website has the webpack packaging that comes with the vue-cli scaffolding, but I want gulp to compile and webpack packaging. Vue is a framework. I want to make a Family Bucket scaffolding project. I don’t know how to start. I’m asking for expert advice!
淡淡烟草味2017-05-24 11:38:00
First of all, why use Gulp to compile? When he first learned about Webpack, the respondent also implemented the workflow of Gulp + Webpack. It can work and can be maintained, but in fact it brings unnecessary complexity. There is actually no task in the build system that requires the use of Gulp. In a Gulp + Webpack project, two sets of hundred-line-level packaging configurations need to be maintained, which is actually inconvenient to use. The functions of Gulp can be completely replaced by NPM Script, which is also the current trend. It's understandable if you want to maintain your existing knowledge of the technology stack and want to introduce Gulp, but it's not required.
It is recommended to streamline the code and implement the configuration template of vue + webpack on the premise of understanding the Webpack configuration of vue-cli. The answerer's practice is that a Webpack template that can meet the size requirements of a medium (10,000-line) Vue project can be put down with only one config.js, and there is no need to even distinguish between webpack.dev.js and webpack.prod.js. module.
For reference, this is the 100-line Vue medium-scale project template mentioned above. The configuration within 100 lines realizes common support for HMR, preprocessor, dependency extraction, inline images, CSS extraction, HTML generation, reverse proxy, etc. Front-end engineering functions:
https://github.com/doodlewind...
This is the Gulpfile template from the Gulp + Webpack project:
https://github.com/doodlewind...