-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathwebpack.config.js
56 lines (53 loc) · 1.25 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
49
50
51
52
53
54
55
56
const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: "./src/index",
mode: "development",
devtool: "source-map",
node: {
global: false
},
output: {
filename: "amazon-connect-chat.js",
path: path.resolve(__dirname, "dist")
},
resolve: {
extensions: [".js"]
},
module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
exclude: /node_modules/,
loader: require.resolve("babel-loader"),
options: {
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// Don't waste time on Gzipping the cache
cacheCompression: false
}
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, "src/index.d.ts"),
to: path.resolve(__dirname, "dist")
}
]
})
],
devServer: {
compress: false,
hot: true,
static: {
directory: path.resolve(__dirname, "showcase"),
watch: true
}
}
};