-
Notifications
You must be signed in to change notification settings - Fork 195
/
webpack.common.js
54 lines (52 loc) · 1.19 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
45
46
47
48
49
50
51
52
53
54
/* eslint-disable no-undef*/
const path = require("path");
const webpack = require("webpack");
const pkg = require("./package.json");
const ESLintPlugin = require('eslint-webpack-plugin');
const banner = `${pkg.name} v${pkg.version}
${pkg.description}
Author: ${pkg.author}`;
module.exports = {
target: "web",
entry: {
'3Dmol': [
"./src/index.ts",
"./src/SurfaceWorker.js",
"./src/exporter.js"
],
'3Dmol.ui': [
"./src/ui/ui.js",
"./src/ui/state.js",
"./src/ui/icon.js",
"./src/ui/form.js",
"./src/ui/defaultValues.js"
]
},
output: {
path: path.resolve(__dirname, "build"),
library: '[name]',
libraryTarget: "umd",
globalObject: "this"
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"],
},
module: {
rules: [
{ test: /\.tsx?$/, loader: "ts-loader" },
{ test: /\.frag$/, loader: "raw-loader" },
{ test: /\.vert$/, loader: "raw-loader" }
],
},
plugins: [
new webpack.ProvidePlugin({
MMTF: path.resolve(__dirname, "./src/vendor/mmtf.js"),
$: "jquery"
}),
new webpack.BannerPlugin({ banner }),
new ESLintPlugin()
],
stats: {
errorDetails: true,
}
};