2020-12-17 15:24:40 +00:00
|
|
|
const
|
|
|
|
webpack = require('webpack'),
|
|
|
|
fs = require('fs'),
|
|
|
|
packageJson = fs.readFileSync('./package.json'),
|
|
|
|
version = JSON.parse(packageJson).version || 'Unknown';
|
|
|
|
|
2020-12-12 19:01:36 +00:00
|
|
|
module.exports = {
|
2020-12-12 21:35:55 +00:00
|
|
|
publicPath: '',
|
2020-12-17 13:49:25 +00:00
|
|
|
assetsDir: 'live-atlas',
|
|
|
|
|
|
|
|
pluginOptions: {
|
|
|
|
svgSprite: {
|
|
|
|
loaderOptions: {
|
|
|
|
extract: true,
|
|
|
|
spriteFilename: 'live-atlas/img/icons.[hash:8].svg'
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2020-12-12 21:35:55 +00:00
|
|
|
|
2020-12-17 15:24:40 +00:00
|
|
|
configureWebpack: {
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
PACKAGE_VERSION: '"' + version + '"'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2020-12-12 21:35:55 +00:00
|
|
|
chainWebpack: config => {
|
2020-12-16 22:41:24 +00:00
|
|
|
config.plugin('html')
|
|
|
|
.tap(args => {
|
|
|
|
args[0].minify = false
|
|
|
|
return args
|
|
|
|
})
|
2020-12-12 21:35:55 +00:00
|
|
|
config.module
|
|
|
|
.rule('svg-sprite')
|
|
|
|
.use('svgo-loader')
|
|
|
|
.loader('svgo-loader')
|
|
|
|
}
|
|
|
|
}
|