-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.dev.js
40 lines (38 loc) · 908 Bytes
/
webpack.dev.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
const path = require("path")
const { CleanWebpackPlugin } = require("clean-webpack-plugin")
const CopyWebpackPlugin = require("copy-webpack-plugin")
const common = require("./webpack.common.js")
module.exports = {
...common,
mode: "development",
entry: "./example/index.tsx",
output: {
path: path.resolve(__dirname, "./example/build"),
filename: "index.js",
library: "react-layered-image",
libraryTarget: "umd",
globalObject: "this",
},
devServer: {
static: "./example/build",
host: "0.0.0.0",
port: 8080,
},
plugins: [
new CleanWebpackPlugin({
cleanAfterEveryBuildPatterns: ["example/build"],
}),
new CopyWebpackPlugin({
patterns: [
{
from: "./example/index.html",
to: "./index.html",
},
{
from: "./example/static/",
to: "./static/",
},
],
}),
],
}