2018-05-19 10:19:21 +02:00
|
|
|
const Dotenv = require('dotenv-webpack');
|
2018-12-21 09:04:25 +01:00
|
|
|
const path = require('path');
|
2018-05-18 11:28:29 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
lintOnSave: false,
|
2018-07-04 14:29:17 +02:00
|
|
|
runtimeCompiler: true,
|
2019-04-17 17:13:20 +02:00
|
|
|
outputDir: '../priv/static/js',
|
2018-05-18 11:28:29 +02:00
|
|
|
configureWebpack: {
|
|
|
|
plugins: [
|
2018-12-21 09:04:25 +01:00
|
|
|
new Dotenv({ path: path.resolve(process.cwd(), '../.env') }),
|
2018-05-18 11:28:29 +02:00
|
|
|
],
|
2019-01-18 14:47:10 +01:00
|
|
|
module: {
|
|
|
|
rules: [ // fixes https://github.com/graphql/graphql-js/issues/1272
|
|
|
|
{
|
|
|
|
test: /\.mjs$/,
|
|
|
|
include: /node_modules/,
|
|
|
|
type: 'javascript/auto',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-04-17 17:13:20 +02:00
|
|
|
output: {
|
|
|
|
filename: 'app.js'
|
|
|
|
}
|
2018-05-18 11:28:29 +02:00
|
|
|
},
|
2019-03-04 17:20:18 +01:00
|
|
|
chainWebpack: config => {
|
|
|
|
config
|
|
|
|
.plugin('html')
|
|
|
|
.tap(args => {
|
|
|
|
args[0].minify = {
|
|
|
|
collapseWhitespace: true,
|
|
|
|
removeComments: false,
|
|
|
|
removeRedundantAttributes: true,
|
|
|
|
removeScriptTypeAttributes: true,
|
|
|
|
removeStyleLinkTypeAttributes: true,
|
|
|
|
useShortDoctype: true
|
|
|
|
};
|
|
|
|
return args
|
|
|
|
});
|
2019-04-24 20:50:05 +02:00
|
|
|
|
|
|
|
config.module
|
|
|
|
.rule("vue")
|
|
|
|
.use("vue-svg-inline-loader")
|
|
|
|
.loader("vue-svg-inline-loader")
|
|
|
|
.options({ /* ... */ });
|
2019-03-04 17:20:18 +01:00
|
|
|
}
|
2018-05-18 11:28:29 +02:00
|
|
|
};
|