const path = require('path');
module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? '/admin/' : '/',
    devServer: {
        port: 8081
    },
    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();
        }
    }
};
