forked from neuroanatomy/BrainBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.atlasmaker-tools.config.js
47 lines (45 loc) · 1.19 KB
/
webpack.atlasmaker-tools.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
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
var glob = require("glob");
const list = glob.sync("./view/atlasMaker/src/tools/*/index.js");
const entries = {};
for(const item of list) {
const arr = item.split('/');
const key = arr[arr.length-2]; // module name is directory's name
entries[key] = item;
}
console.log(entries);
module.exports = {
mode: 'development',
entry: entries,
devtool: 'eval-source-map',
plugins: [new CleanWebpackPlugin(['dist'])],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'view/atlasMaker/dist/atlasMaker-tools')
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(svg)$/,
use: {
loader: 'url-loader',
options: {
noquotes: true
}
}
},
{
test: /\.(html)$/,
use: ['html-loader']
}
]
}
};