-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.web.config.js
57 lines (52 loc) · 1.61 KB
/
webpack.web.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
const webpack = require("webpack");
const path = require("path");
const MemoryFileSystem = require("memory-fs");
const memoryFs = new MemoryFileSystem();
const compiler = webpack({
entry: "./src/index.web.ts",
mode: "development",
target: "web",
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
projectReferences: true,
configFile: "./tsconfig.json",
transpileOnly: true,
// TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
// introduced when upgrading from 5.5.3 to 5.5.4 ¯\_(ツ)_/¯
ignoreDiagnostics: [5069]
}
},
exclude: /node_modules/
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
externals: ["spdx-satisfies"],
output: {
filename: "web.js",
path: path.resolve(__dirname, "dist")
}
});
compiler.outputFileSystem = memoryFs;
compiler.run((err, stats) => {
if (err) {
console.error(err);
return;
}
if (stats.hasErrors()) {
console.log(
stats.toString({
chunks: false, // Makes the build much quieter
colors: true // Shows colors in the console
})
);
process.exitCode = 1;
} else console.log(`No NodeJS specific code found for web version!`);
});