forked from adobe/commerce-events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
44 lines (40 loc) · 1.16 KB
/
webpack.common.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
const path = require("path");
const webpack = require("webpack");
const { name, version } = require("./package.json");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const copyRightText = "Copyright © Adobe, Inc. All rights reserved.See COPYING.txt for license details.";
const banner = `${name}@v${version}\n${copyRightText}`;
const config = {
entry: "./src/index.ts",
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
publicPath: "",
library: {
name: "magentoStorefrontEventCollector",
type: "umd",
export: "default",
umdNamedDefine: true,
},
clean: true,
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /node_modules/,
},
],
},
plugins: [new HtmlWebpackPlugin(), new webpack.BannerPlugin(banner)],
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
devServer: {
static: path.join(__dirname, "dist"),
hot: true,
port: 8081,
},
};
module.exports = config;