-
Notifications
You must be signed in to change notification settings - Fork 2
/
scripts.config.js
51 lines (47 loc) · 1.34 KB
/
scripts.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
const path = require('path');
const ShellPlugin = require('webpack-shell-plugin-next');
const scriptsDir = path.resolve(__dirname, 'scripts');
const symbolGenFilename = 'symbol_gen.js';
const symbolSourceConfig = {
mode: 'development',
target: 'node',
entry: path.resolve(__dirname, 'node_modules/katex/src/symbols.js'),
output: {
path: path.resolve(scriptsDir, 'dist'),
filename: 'symbols.js'
},
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules\/(?!katex)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-flow'],
},
},
}
],
},
}
const symbolGenConfig = {
mode: 'development',
target: 'node',
entry: path.resolve(scriptsDir, symbolGenFilename),
output: {
path: path.resolve(scriptsDir, 'dist'),
filename: symbolGenFilename
},
plugins: [
new ShellPlugin({
onBuildEnd: {
scripts: [`node ${path.resolve(scriptsDir, 'dist', symbolGenFilename)}`],
blocking: true,
parallel: false
}
})
]
}
module.exports = [symbolSourceConfig, symbolGenConfig]