一、根目录新建vue.config.js
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? '/production-sub-path/'
: '/', // 输出文件目录
outputDir: 'dist', // eslint-loader 是否在保存的时候检查
lintOnSave: true, // use the full build with in-browser compiler? // https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
devtool: 'source-map' // 配置开发者环境的sourceMap用于断点调试
},
productionSourceMap: false, // css相关配置
css: {
// 是否使用css分离插件 ExtractTextPlugin
extract: process.env.NODE_ENV === 'production', // 开启 CSS source maps?
sourceMap: false, // css预设器配置项
loaderOptions: {}, // 启用 CSS modules for all css / pre-processor files.
modules: false
},
devServer: {