-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathwebpack.deps.config.ts
More file actions
57 lines (52 loc) · 1.58 KB
/
webpack.deps.config.ts
File metadata and controls
57 lines (52 loc) · 1.58 KB
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
import { Configuration } from "webpack";
const path = require("path");
module.exports = (env: any, argv: any) => {
const conf: Configuration = {
mode: "production",
entry: {
exampleDependencies: [`./node_modules/scichart-example-dependencies/lib/index.js`],
},
output: {
path: path.join(__dirname, "build"),
filename: argv.mode === "production" ? `[name].browser.js` : `[name].browser.dev.js`,
library: "SciChartExampleDependencies",
libraryExport: "default",
libraryTarget: "global",
globalObject: "self",
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /(node_modules)/,
use: [
{
loader: "ts-loader",
},
],
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
};
if (argv.mode !== "production") {
// @ts-ignore
conf.devtool = "inline-source-map";
}
const esmConfig: Configuration = {
...conf,
experiments: {
outputModule: true,
},
output: {
path: path.join(__dirname, "build"),
filename: argv.mode === "production" ? `[name].browser.mjs` : `[name].browser.dev.mjs`,
globalObject: "self",
libraryTarget: "module",
},
};
return [esmConfig, conf];
};
module.exports.parallelism = 1;