-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
vue.config.js
81 lines (79 loc) · 1.66 KB
/
vue.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const WorkerPlugin = require('worker-plugin')
const path = require('path')
const webpack = require('webpack')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
publicPath: './',
productionSourceMap: false,
devServer: {
writeToDisk: true,
},
filenameHashing: false,
configureWebpack: {
plugins: [
new WorkerPlugin(),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
}),
],
output: {
globalObject: 'globalThis',
filename: '[name].js',
},
entry: {
'lib/core': path.join(__dirname, 'src/mal-lib/core.ts'),
'lib/color': path.join(__dirname, 'src/mal-lib/color.ts'),
'lib/path': path.join(__dirname, 'src/mal-lib/path.ts'),
'lib/math': path.join(__dirname, 'src/mal-lib/math.ts'),
'js/generator': path.join(__dirname, 'src/generator.ts'),
},
node: {
__dirname: false,
},
},
css: {
loaderOptions: {
css: {
url: false,
},
},
},
chainWebpack: config => {
config.plugin('html-js/index').tap(args => {
args[0].hash = true
args[0].minify = {
removeComments: false,
collapseWhitespace: false,
removeAttributeQuotes: false,
collapseBooleanAttributes: false,
removeScriptTypeAttributes: false,
}
return args
})
// Copy logo.png to dist
config.plugin('copy-assets').use(CopyPlugin, [
{
patterns: [
{
from: 'assets/logo.png',
to: '.',
},
],
},
])
},
pages: {
'js/index': {
entry: 'src/pages/index.ts',
template: 'public/index.html',
filename: 'index.html',
},
'js/embed': {
entry: 'src/pages/embed.ts',
template: 'public/embed.html',
filename: 'embed.html',
},
},
}