forked from finos/FDC3-conformance-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
62 lines (59 loc) · 1.56 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
const path = require("path");
const webpack = require("webpack");
const isProduction = process.env.NODE_ENV == "production";
const config = {
entry: {
'fdc3-compliance-v1.2': "./src/test/v1.2/index.ts",
'channel-v1.2': "./src/mock/v1.2/channel.ts",
'general-v1.2': "./src/mock/v1.2/general.ts",
'intent-a-v1.2': "./src/mock/v1.2/intent-a.ts",
'intent-b-v1.2': "./src/mock/v1.2/intent-b.ts",
'intent-c-v1.2': "./src/mock/v1.2/intent-c.ts",
'fdc3-compliance-v2.0': "./src/test/v2.0/index.ts",
'channel-v2.0': "./src/mock/v2.0/channel.ts",
'general-v2.0': "./src/mock/v2.0/general.ts",
'metadata-v2.0': "./src/mock/v2.0/metadata.ts",
},
devtool: "source-map",
output: {
filename: '[name].js',
//globalObject: 'this',
path: path.resolve(__dirname, "./dist/lib"),
},
plugins: [
new webpack.ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
}),
],
module: {
rules: [
{
test: /\.(ts|tsx)$/i,
loader: "ts-loader",
exclude: [path.resolve(__dirname, "/node_modules/")],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
fallback: {
util: require.resolve("util/"),
stream: require.resolve("stream-browserify/"),
buffer: require.resolve("buffer/"),
window: false,
},
},
};
module.exports = () => {
if (isProduction) {
config.mode = "production";
} else {
config.mode = "development";
}
return config;
};