forked from ncats/protvista-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
62 lines (59 loc) · 1.28 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
57
58
59
60
61
62
const webpack = require('webpack');
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const PACKAGE_ROOT_PATH = process.cwd();
const config = {
entry: ['./src/index.ts'],
output: {
path: path.resolve(PACKAGE_ROOT_PATH, 'dist'),
publicPath: '/',
chunkFilename: '[name].js',
library: 'ProtvistaUniprot',
filename: 'protvista-uniprot.js',
clean: true,
},
target: 'web',
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.js', '.css'],
},
externals: {
d3: 'd3',
},
module: {
rules: [
{
test: /\.(js|ts)$/,
exclude:
/node_modules\/(?!(lit-element|lit-html|timing-functions|protvista-*|data-loader)).*/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.svg$/,
loader: 'svg-inline-loader',
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'src/icons', to: 'es/icons' },
{ from: 'src/models', to: 'es/models' }
],
}),
],
devServer: {
contentBase: [
path.join(__dirname, 'public'),
path.join(__dirname, 'node_modules'),
],
open: true,
},
};
module.exports = config;