-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
54 lines (52 loc) · 1.29 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
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
const entry = path.join(__dirname, 'src', 'index.js');
const html = path.join(__dirname, 'src', 'index.html');
const style = path.join(__dirname, 'src', 'style.css');
const itkWebWorkers = path.join('itk', 'WebWorkers', 'ImageIO.worker.js');
const itkImageIOs = path.join('itk', 'ImageIOs');
const nodeModules = path.join(__dirname, 'node_modules');
const dist = path.join(__dirname, 'dist');
module.exports = {
entry,
output: {
path: dist,
filename: 'index.js',
},
plugins: [
new CopyPlugin({
patterns: [
{
from: html,
to: dist,
},
{
from: style,
to: dist,
},
{
from: path.join(nodeModules, itkWebWorkers),
to: path.join(dist, itkWebWorkers),
},
{
from: path.join(nodeModules, itkImageIOs, '*DICOM*'),
to: path.join(dist, itkImageIOs, '[name][ext]'),
},
{
from: path.join(nodeModules, itkImageIOs, '*GDCM*'),
to: path.join(dist, itkImageIOs, '[name][ext]'),
},
],
}),
],
devtool: 'source-map',
resolve: {
extensions: ['.js'],
},
devServer: {
static: {
directory: dist,
},
hot: false,
},
};