const path = require('path');
module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? '/admin/' : '/',
    devServer: {
        port: 8082,
        open: true,
        proxy: process.env.VUE_APP_BASE_URL
    },
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [path.resolve(__dirname, './src/styles/common/*.less')]
        }
    },
    chainWebpack: config => {
        if (process.env.NODE_ENV === 'development') {
            config.output.filename('[name].[hash].js').end();
        }
    }
};
