美文网首页
vue-cli 3.0 配置vue.config.js

vue-cli 3.0 配置vue.config.js

作者: 卓小生 | 来源:发表于2018-09-28 06:58 被阅读0次
const webpack = require('webpack')
const path = require('path');

function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    // 基本路径
    baseUrl: './',
    devServer: {
        port: 8888,
        open: true
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                jQuery: 'jquery',
                $: 'jquery'
            })
        ]
    },
    productionSourceMap: false,
    lintOnSave: false,
    chainWebpack: config => {
        config.entry.app = ["babel-polyfill", resolve('src/main.js')],
        config.resolve.alias
            .set('@', resolve('src'))
            .set('./@assets', resolve('src/assets'))
            .set('@components', resolve('src/components'))
            .set('@store', resolve('src/store'))
            .set('@utils', resolve('src/utils'))
            .set('@serviceSupervision', resolve('src/components/pages/serviceSupervision'))
            .set('@onlineRevision', resolve('src/components/pages/onlineRevision'))
            .set('@evaluate', resolve('src/components/pages/evaluate'))
            .set('@TablesAndChairs', resolve('src/components/pages/TablesAndChairs'))
            .set('@font', resolve('src/font'));
    }
}

相关文章

网友评论

      本文标题:vue-cli 3.0 配置vue.config.js

      本文链接:https://www.haomeiwen.com/subject/uplrpftx.html