-
Notifications
You must be signed in to change notification settings - Fork 18
/
poi.config.js
43 lines (39 loc) · 985 Bytes
/
poi.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
const { name, version } = require('./package.json');
const revision = require('git-rev-sync').short();
const aliases = {
'choices.js$': 'choices.js/public/assets/scripts/choices.js'
};
const isProduction = process.env.NODE_ENV === 'production';
/** @type {import('poi').Config} */
const config = {
plugins: [
'@poi/bundle-report'
],
entry: './index.js',
output: {
html: {
version,
revision,
template: 'index.html',
filename: isProduction ? '200.html' : 'index.html',
appname: name
},
sourceMap: !isProduction
},
chainWebpack(config) {
config.resolve.alias.merge(aliases);
/* eslint-disable indent */
config.module.rule('aot')
.test(/\.js$/)
.enforce('pre')
.resourceQuery(/\?aot$/)
.exclude
.add(/node_modules/)
.end()
.use('aot-loader')
.loader(require.resolve('aot-loader'));
/* eslint-enable indent */
}
};
module.exports = config;