forked from sameerkumar18/corporate-bs-generator-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.ts
48 lines (44 loc) · 1.13 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
import * as path from "path";
import DotenvWebpackPlugin from "dotenv-webpack";
import { Configuration } from "webpack";
const mode =
process.env.NODE_ENV === "development" ? "development" : "production";
const config: Configuration = {
mode: mode,
context: path.join(path.resolve(__dirname), "src"),
entry: "./index.ts",
target: "webworker",
performance: {
hints: false,
},
output: {
filename: "worker.js",
path: path.resolve("worker"),
},
resolve: {
extensions: [".ts", ".js", ".yaml"],
},
plugins: [
new DotenvWebpackPlugin({
path: path.join(__dirname, ".env"),
systemvars: true,
}),
],
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
{
test: /\.yaml$/,
type: "json", // https://www.npmjs.com/package/yaml-loader#usage
use: "yaml-loader",
},
],
},
};
export default config;