-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.base.js
41 lines (41 loc) · 942 Bytes
/
webpack.base.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 ROOT = path.resolve(__dirname);
const root = path.join.bind(path, ROOT);
const webpack = require('webpack');
exports.root = root;
exports.config = {
entry: {
"orda_jsoneditor": [root("src/index.ts")]
},
resolve: {
extensions: [".ts", ".js"],
modules: [root("src"), "node_modules"],
fallback: {
"stream": require.resolve("stream-browserify"),
"buffer": require.resolve("buffer")
}
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: [/node_modules/, root("test/")],
use: [
{
loader: "ts-loader"
}
]
}
]
},
plugins: [
// Work around for Buffer is undefined:
// https://github.com/webpack/changelog-v5/issues/10
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
};