-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
65 lines (62 loc) · 1.98 KB
/
webpack.config.ts
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
import { Configuration } from "webpack";
const path = require("path");
// const CopyPlugin = require("copy-webpack-plugin");
module.exports = (env: any, argv: any) => {
const conf: Configuration = {
// devServer: {
// static: path.join(__dirname, "build"),
// port: 8080,
// allowedHosts: "all",
// client: {
// overlay: {
// warnings: false,
// errors: true
// }
// }
// },
output: {
path: path.join(__dirname, "dist"),
// filename: argv.mode === "production" ? `[name].browser.js` : `[name].browser.dev.js`,
library: "SciChart-React",
libraryExport: "default",
libraryTarget: "global",
globalObject: "self"
},
// plugins: [
// new CopyPlugin({
// patterns: [
// { from: "../src/_wasm/scichart2d.wasm", to: "" },
// { from: "../src/_wasm/scichart2d.data", to: "" },
// { from: "../src/_wasm/scichart3d.wasm", to: "" },
// { from: "../src/_wasm/scichart3d.data", to: "" },
// { from: "client/index.html", to: "" },
// { from: "client/example.js", to: "" },
// ]
// })
// ],
module: {
rules: [
{
test: /\.ts$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: "ts-loader"
}
]
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
externals: {
react: "react"
}
};
if (argv.mode !== "production") {
// @ts-ignore
conf.devtool = "inline-source-map";
}
return conf;
};