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');
|
|
|
|
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('|') + ')$'),
|
|
|
|
threshold: 10240,
|
|
|
|
minRatio: 0.8
|
|
|
|
})
|
|
|
|
],
|
|
|
|
},
|
2018-11-05 15:26:18 +00:00
|
|
|
chainWebpack: config => {
|
2019-08-08 13:12:39 +01:00
|
|
|
config.output.chunkFilename(`js/vendors.js`);
|
|
|
|
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
|
|
|
}
|
|
|
|
};
|