-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.js
41 lines (37 loc) · 915 Bytes
/
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
const path = require('path');
const hyphenLangs = [
'en-us',
];
let hyphenLibs = {};
for (let lang of hyphenLangs) {
hyphenLibs[`hyphens_${lang}`] = `hyphenation.${lang}`;
}
module.exports = {
entry: {
demos: './src/demos/layout.ts',
lib: './src',
...hyphenLibs,
},
devtool: 'cheap-source-map',
module: {
rules: [{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
}],
},
resolve: {
extensions: ['.ts'],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
// Build a UMD bundle that can be used from a `<script>` tag, or imported
// into a CommonJS / ESM environment.
libraryTarget: 'umd',
library: 'texLineBreak_[name]',
// Make the UMD bundle usable in Node.
// See https://github.com/webpack/webpack/issues/6522
globalObject: "typeof self !== 'undefined' ? self : this",
},
};