We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack4 内置了很多插件,所以之前一些需要手动引入的插件都不用再引入了。
entry, output, rules, plugins 主要就是这四个东西
entry
output
rules
plugins
vue-loader 需要显式在plugins数组里引入,不然会报错
vue-loader
const { VueLoaderPlugin } = require('vue-loader') /* ... */ plugins: [ new VueLoaderPlugin() // webpack 4 vue-loader需要这样使用 ]
新增了mode,可以不用手动设置process.env.NODE_ENV了
mode
process.env.NODE_ENV
mode: 'development' // 自动设置`process.env.NODE_ENV`的值为"development"
而且还会根据当前的构建环境来执行默认内置的插件,进行优化
具体参考 webpack中文网
The text was updated successfully, but these errors were encountered:
typo: vue-loader 需要显示在plugins数组里引入,不然会报错 ===》 显式在plugin引入
Sorry, something went wrong.
No branches or pull requests
webpack4 内置了很多插件,所以之前一些需要手动引入的插件都不用再引入了。
webpack的基础概念
entry
,output
,rules
,plugins
主要就是这四个东西
webpack4新写法
vue-loader
需要显式在plugins数组里引入,不然会报错新增了
mode
,可以不用手动设置process.env.NODE_ENV
了而且还会根据当前的构建环境来执行默认内置的插件,进行优化
具体参考
webpack中文网
code spliting
缓存
manifest & runtime & vendor
The text was updated successfully, but these errors were encountered: