module.exports = {
	publicPath: '/',
	lintOnSave: true,
	productionSourceMap: false,

	devServer: {
		port: '7777',
		proxy: {
			'/dev': {
				target: 'http://api.s.huaml.com',

				changeOrigin: true,
				pathRewrite: { '^/dev': '' }
			},
			'/pro': {
				target: 'http://api.b.huaml.com',

				changeOrigin: true,
				pathRewrite: { '^/pro': '/api' }
			}
		}
	},

	chainWebpack: config => {
		config.module.rule('svg').uses.clear();
		config.module
			.rule('svg-sprite-loader')
			.test(/.svg$/)
			.exclude.add(/node_modules/)
			.end()
			.use('svg-sprite-loader')
			.loader('svg-sprite-loader')
			.options({
				symbolId: '[name]'
			});
	},

	css: {
		loaderOptions: {
			sass: {
				data: `@import "@/assets/css/base.scss";`
			}
		}
	}
};
