- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 129字
- 2021-07-02 19:57:14
Module build
As we saw earlier, Vue can be dropped into a project as an external script for direct use in a browser. Vue is also available as an NPM module for use in more sophisticated projects, including a build tool such as Webpack.
If you're unfamiliar with Webpack, it's a module bundler that takes all your project assets and bundles them up into something you can provide to the browser. In the bundling process, you can transform those assets as well.
Using Vue as a module and introducing Webpack opens possibilities such as the following:
- Single-file components
- ES feature proposals not currently supported in browsers
- Modularized code
- Pre-processors such as SASS and Pug
We will be exploring Webpack more extensively in Chapter 5,Integrating Laravel and Vue.js with Webpack.