1.vue inspect > output.js 将配置按webpack.config.js输出
2.一般配置在vue.config.js中配置
configureWebpack: (config) => { // 简单/基础配置,比如引入一个新插件 config.devtool = 'sourceMap' }, //webpackchain:https://github.com/neutrinojs/webpack-chain chainWebpack: (config) => { // 链式配置// Create named rules which can be modified later
config.module .rule('lint') .test(/\.js$/) .pre() .include .add('src') .end() // Even create named uses (loaders) .use('eslint') .loader('eslint-loader') .options({ rules: { semi: 'off' } });
} css: { loaderOptions: { css: { // 这里的选项会传递给 commonCss-loader }, postcss: { // 这里的选项会传递给 postcss-loader } }, extract: process.env.NODE_ENV === 'development' ? false : true, sourceMap: true }, loaderOptions: { css: { // options here will be passed to css-loader }, postcss: { // options here will be passed to postcss-loader } }