forked from KaTeX/KaTeX
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
61 lines (56 loc) · 1.57 KB
/
webpack.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
const path = require('path');
const katexConfig = {
entry: ['./katex.js'],
output: {
path: path.join(__dirname, 'build'),
filename: 'katex.js',
library: 'katex',
libraryTarget: 'umd',
},
};
const copyTexConfig = {
entry: ['./contrib/copy-tex/copy-tex.js'],
output: {
path: path.join(__dirname, 'build', 'contrib', 'copy-tex'),
filename: 'copy-tex.js',
},
};
const autoRenderConfig = {
entry: ['./contrib/auto-render/auto-render.js'],
output: {
path: path.join(__dirname, 'build', 'contrib', 'auto-render'),
filename: 'auto-render.js',
library: 'renderMathInElement',
libraryTarget: 'umd',
},
};
const commonConfig = {
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules\//,
},
],
},
devtool: 'eval-source-map',
};
module.exports = {
compilerConfig: [
Object.assign({}, katexConfig, commonConfig),
Object.assign({}, copyTexConfig, commonConfig),
Object.assign({}, autoRenderConfig, commonConfig),
],
devServerConfig: {
publicPath: '/',
contentBase: path.join(__dirname, 'build'),
stats: {
colors: true,
},
// Allow server to be accessed from anywhere, which is useful for
// testing. This potentially reveals the source code to the world,
// but this should not be a concern for testing open-source software.
disableHostCheck: true,
},
};