forked from allen-cell-animated/vole-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
56 lines (54 loc) · 1.33 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
entry: ["./public/index.js"],
output: {
path: path.resolve(__dirname, "volumeviewer"),
filename: "volume-viewer-ui.bundle.js",
publicPath: "/volumeviewer/",
},
devtool: "cheap-module-source-map",
devServer: {
publicPath: "/volumeviewer/",
openPage: "volumeviewer/",
port: 9020,
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: "./public/index.html",
}),
new webpack.DefinePlugin({
APP_VERSION: JSON.stringify(require("./package.json").version),
}),
new CopyWebpackPlugin({ patterns: ["public"] }),
],
resolve: {
extensions: [".js"],
},
module: {
rules: [
{
test: /\.js$/,
include: [path.resolve(__dirname, "public")],
exclude: /node_modules/,
use: "babel-loader",
},
{
test: /Worker\.js$/,
use: "worker-loader?inline=true",
},
{
test: /\.(obj)$/,
use: ["raw-loader?inline=true"],
},
{
test: /\.(png)$/,
use: ["url-loader?inline=true"],
},
],
},
};