Need advice about which tool to choose?Ask the StackShare community!
Vue CLI vs Webpack: What are the differences?
- Vue CLI: Vue CLI is a command line interface tool that helps developers quickly scaffold and set up new Vue.js projects. It provides a pre-configured development environment with all the necessary build tools and plugins.
Webpack: Webpack is a module bundler that is primarily used to bundle JavaScript files and their dependencies into a single file. It allows developers to split their code into different modules and optimize the final bundle for performance.
Dependency Management: Vue CLI automatically manages project dependencies using npm or yarn, while Webpack requires developers to manually manage dependencies by specifying them in a separate configuration file.
Project Structure: Vue CLI follows a convention-based project structure with specific directories for components, assets, and views. It provides a standardized layout for Vue projects, making it easier for developers to navigate and understand the codebase. On the other hand, Webpack does not enforce any specific project structure and allows developers to organize their code according to their preferences.
Plugin Ecosystem: Vue CLI has a rich plugin ecosystem that allows developers to extend its functionality and add additional features to their projects. It provides a curated list of officially supported plugins that can be easily installed and configured. Webpack also supports plugins, but it requires developers to manually configure and install them.
Configurability: Vue CLI abstracts away the underlying Webpack configuration, providing developers with an opinionated and simplified development experience. It allows developers to override the default configuration by modifying a specific configuration file. Webpack, on the other hand, gives developers more control over the configuration process, allowing them to fine-tune every aspect of the bundling process.
In summary, Vue CLI is a command line interface tool that simplifies project setup and management for Vue.js projects, while Webpack is a module bundler that focuses on bundling JavaScript files and their dependencies. Vue CLI automatically manages dependencies, follows a convention-based project structure, has a rich plugin ecosystem, and provides a simplified development experience. Webpack requires manual dependency management, allows flexible project structure, supports plugins, and provides more control over the bundling process.
I could define the next points why we have to migrate:
- Decrease build time of our application. (It was the main cause).
- Also
jspm install
takes much more time thannpm install
. - Many config files for SystemJS and JSPM. For Webpack you can use just one main config file, and you can use some separate config files for specific builds using inheritance and merge them.
We mostly use rollup to publish package onto NPM. For most all other use cases, we use the Meteor build tool (probably 99% of the time) for publishing packages. If you're using Node on FHIR you probably won't need to know rollup, unless you are somehow working on helping us publish front end user interface components using FHIR. That being said, we have been migrating away from Atmosphere package manager towards NPM. As we continue to migrate away, we may publish other NPM packages using rollup.
Pros of Vue CLI
- GUI for installing dependencies1
- Visual Web Interface1
- Detects and run npm tasks1
Pros of Webpack
- Most powerful bundler309
- Built-in dev server with livereload182
- Can handle all types of assets142
- Easy configuration87
- Laravel-mix22
- Overengineered, Underdeveloped4
- Makes it easy to bundle static assets2
- Webpack-Encore2
- Redundant1
- Better support in Browser Dev-Tools1
Sign up to add or upvote prosMake informed product decisions
Cons of Vue CLI
Cons of Webpack
- Hard to configure15
- No clear direction5
- Spaghetti-Code out of the box2
- SystemJS integration is quite lackluster2
- Loader architecture is quite a mess (unreliable/buggy)2
- Fire and Forget mentality of Core-Developers2