-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathwebpack.common.js
More file actions
53 lines (50 loc) · 1.27 KB
/
Copy pathwebpack.common.js
File metadata and controls
53 lines (50 loc) · 1.27 KB
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
const webpack = require("webpack");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const path = require("path");
const { DEFAULT_STATS } = require("../../config/webpack");
const packageJson = require("./package.json");
const BUILD_PATH = path.resolve(__dirname, "./build");
const config = {
entry: {
index: path.resolve(__dirname, "./src/index.ts"),
},
devtool: "source-map",
output: {
globalObject: "this",
library: "freighterApi",
libraryTarget: "umd",
path: BUILD_PATH,
filename: "[name].min.js",
},
resolve: {
extensions: [".ts", ".js"],
plugins: [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, "./tsconfig.json"),
}),
],
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: ["ts-loader"],
},
],
},
resolveLoader: {
modules: [path.resolve(__dirname, "../../node_modules")],
},
plugins: [
new webpack.DefinePlugin({
DEV_SERVER: false,
__PACKAGE_VERSION__: JSON.stringify(packageJson.version),
}),
new webpack.NormalModuleReplacementPlugin(
/webextension-polyfill/,
path.resolve(__dirname, "../../config/shims/webextension-polyfill.ts"),
),
],
stats: DEFAULT_STATS,
};
module.exports = config;