forked from pipe-cd/pipecd
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.2 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
/* eslint @typescript-eslint/no-var-requires: 0 */
"use strict";
require("dotenv").config();
const path = require("path");
const webpack = require("webpack");
const { merge } = require("webpack-merge");
const webpackBaseConfig = require("./webpack.common");
module.exports = (env) => {
return merge(webpackBaseConfig(env), {
mode: "production",
entry: {
index: "./src/index.tsx",
},
resolve: {
//extensions: [".mjs", ".js", ".jsx"],
extensions: [".mjs", ".ts", ".tsx", ".js"],
alias: {
pipecd: path.resolve(__dirname, ".."),
"~": path.resolve(__dirname, "src"),
"~~": path.resolve(__dirname),
},
modules: [path.resolve(__dirname, "node_modules"), "node_modules"],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
{
type: "javascript/auto",
test: /\.m?js$/,
resolve: { fullySpecified: false },
use: [],
},
],
},
plugins: [
new webpack.EnvironmentPlugin({
PIPECD_VERSION: process.env.PIPECD_VERSION || null,
}),
],
});
};