forked from hpcc-systems/vscode-ecl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
113 lines (103 loc) · 3.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* eslint-disable */
const path = require("path");
const makeConfig = (argv, { entry, target = "node", library = { type: "commonjs" }, dist = "dist", externals = {} }) => ({
mode: argv.mode,
devtool: argv.mode === "production" ? false : "source-map",
target,
entry,
output: {
path: path.resolve(__dirname, dist),
filename: "[name].js",
library,
globalObject: "this",
devtoolModuleFilenameTemplate: "../[resource-path]",
},
externals: {
"vscode": "commonjs vscode", // ignored because it doesn't exist
"applicationinsights-native-metrics": "commonjs applicationinsights-native-metrics", // ignored because we don't ship native module
...externals
},
module: {
rules: [{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
}, {
test: /\.js$/,
enforce: "pre",
use: [
{
loader: "source-map-loader",
options: {
filterSourceMappingUrl: (url, resourcePath) => {
if (resourcePath.includes("undici")) {
return false;
}
return true;
},
}
}]
}]
},
resolve: {
fallback: {
"@hpcc-js": path.resolve(__dirname, "../hpcc-js/packages"),
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
// console: require.resolve('console-browserify'),
// constants: require.resolve('constants-browserify'),
// crypto: require.resolve('crypto-browserify'),
// domain: require.resolve('domain-browser'),
// events: require.resolve('events'),
// http: require.resolve('stream-http'),
// https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
// punycode: require.resolve('punycode'),
// process: require.resolve('process/browser'),
// querystring: require.resolve('querystring-es3'),
stream: require.resolve('stream-browserify'),
// string_decoder: require.resolve('string_decoder'),
// sys: require.resolve('util'),
// timers: require.resolve('timers-browserify'),
// tty: require.resolve('tty-browserify'),
// url: require.resolve('url'),
// util: require.resolve('util'),
// vm: require.resolve('vm-browserify'),
zlib: require.resolve('browserify-zlib')
}
},
experiments: {
outputModule: library?.type === "module"
},
plugins: [],
performance: {
hints: false
}
});
module.exports = (env, argv) => [
makeConfig(argv, {
entry: {
extension: "./lib-es6/extension.js",
debugger: "./lib-es6/debugger.js"
}
}),
makeConfig(argv, {
entry: {
"extension": "./lib-es6/web-extension.js"
},
target: "webworker",
dist: "dist-web",
externals: {
fs: "commonjs fs"
}
}),
makeConfig(argv, {
entry: {
eclwatch: "./lib-es6/eclwatch.js",
wuRenderer: "./lib-es6/notebook/renderers/wuRenderer.js",
ojsRenderer: "./lib-es6/notebook/renderers/ojsRenderer.js"
},
target: "web",
library: { type: "module" }
}),
];