mobilizon.chapril.org-mobil.../js/vue.config.js
Thomas Citharel 5a6ed464b6
Add vue-cli-plugin-webpack-bundle-analyzer and upgrade deps
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-05-31 11:32:50 +02:00

52 lines
1.2 KiB
JavaScript

const Dotenv = require('dotenv-webpack');
const path = require('path');
module.exports = {
pluginOptions: {
webpackBundleAnalyzer: {
openAnalyzer: false
}
},
lintOnSave: false,
runtimeCompiler: true,
outputDir: '../priv/static/js',
configureWebpack: {
plugins: [
new Dotenv({ path: path.resolve(process.cwd(), '../.env') }),
],
module: {
rules: [ // fixes https://github.com/graphql/graphql-js/issues/1272
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
output: {
filename: 'app.js'
}
},
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].minify = {
collapseWhitespace: true,
removeComments: false,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true
};
return args
});
config.module
.rule("vue")
.use("vue-svg-inline-loader")
.loader("vue-svg-inline-loader")
.options({ /* ... */ });
}
};