2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-11-27 12:16:52 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2019-07-30 11:13:24 +01:00
|
|
|
const path = require('path');
|
2019-08-08 13:12:39 +01:00
|
|
|
const CompressionWebpackPlugin = require('compression-webpack-plugin');
|
2019-10-28 15:59:19 +00:00
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
2019-08-08 13:12:39 +01:00
|
|
|
const productionGzipExtensions = ['js', 'css', 'ttf'];
|
2019-07-30 11:13:24 +01:00
|
|
|
|
2018-11-05 15:26:18 +00:00
|
|
|
module.exports = {
|
2019-07-30 11:13:24 +01:00
|
|
|
publicPath: "/static/dist",
|
|
|
|
productionSourceMap: false,
|
|
|
|
parallel: true,
|
2019-08-08 13:12:39 +01:00
|
|
|
configureWebpack: {
|
|
|
|
plugins: [
|
|
|
|
new CompressionWebpackPlugin({
|
|
|
|
algorithm: 'gzip',
|
|
|
|
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
2019-11-06 17:44:20 +00:00
|
|
|
threshold: 1024,
|
2019-08-08 13:12:39 +01:00
|
|
|
minRatio: 0.8
|
2019-10-28 15:59:19 +00:00
|
|
|
}),
|
|
|
|
new StyleLintPlugin({
|
|
|
|
files: ['**/*.{vue,sss,less,scss,sass}'],
|
2019-08-08 13:12:39 +01:00
|
|
|
})
|
|
|
|
],
|
|
|
|
},
|
2018-11-05 15:26:18 +00:00
|
|
|
chainWebpack: config => {
|
2019-11-05 10:32:34 +00:00
|
|
|
config.output.chunkFilename(`js/vendors_[name].js`);
|
2019-08-08 13:12:39 +01:00
|
|
|
config.output.filename(`js/app.js`);
|
|
|
|
|
2019-07-30 11:13:24 +01:00
|
|
|
config.resolve.alias
|
|
|
|
.set('@', path.resolve('src'));
|
2019-06-18 14:36:54 +01:00
|
|
|
|
2019-07-30 11:13:24 +01:00
|
|
|
config
|
|
|
|
.plugin('html')
|
|
|
|
.tap(args => {
|
|
|
|
args[0].template = './index.html';
|
|
|
|
return args
|
|
|
|
});
|
2019-10-23 13:26:39 +01:00
|
|
|
|
|
|
|
const svgRule = config.module.rule('svg');
|
|
|
|
|
|
|
|
svgRule.uses.clear();
|
|
|
|
|
|
|
|
svgRule
|
|
|
|
.use('vue-svg-loader')
|
|
|
|
.loader('vue-svg-loader');
|
2019-07-30 11:13:24 +01:00
|
|
|
}
|
|
|
|
};
|