This repository was archived by the owner on Aug 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
66 lines (63 loc) · 1.49 KB
/
webpack.config.js
File metadata and controls
66 lines (63 loc) · 1.49 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
54
55
56
57
58
59
60
61
62
63
64
65
66
const webpack = require("webpack");
const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const PACKAGE_ROOT_PATH = process.cwd();
const config = {
entry: ["./src/index.js"],
output: {
path: path.resolve(PACKAGE_ROOT_PATH, "dist"),
publicPath: "dist/",
chunkFilename: "[name].js",
library: "ProtvistaProteomicsdb",
filename: "protvista-proteomicsdb.js"
},
target: "web",
devtool: "source-map",
resolve: {
extensions: [".js"]
},
externals: {
d3: "d3",
litemol: "LiteMol"
},
plugins: [new CleanWebpackPlugin([path.join(PACKAGE_ROOT_PATH, "dist")])],
module: {
rules: [
{
test: /\.(js)$/,
use: {
loader: "babel-loader",
options: {
babelrc: false,
exclude: /node_modules\/(?!(lit-element|lit-html|protvista-|data-loader)).*/,
presets: [
[
"@babel/preset-env",
{
targets: {
ie: 11,
browsers: "last 2 versions"
},
modules: false
}
]
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
regenerator: true
}
]
]
}
}
},
{
test: /\.svg$/,
loader: "svg-inline-loader"
}
]
}
};
module.exports = config;