forked from enso-org/reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
53 lines (47 loc) · 1.42 KB
/
webpack.config.js
File metadata and controls
53 lines (47 loc) · 1.42 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
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
// assets.js
const Npm = ["marked/marked.min.js",
"luna-logo/index.js",
"jquery/dist/jquery.min.js",
"less/dist/less.min.js",
];
const Less = ["style.less"];
const Data = ["doc.json"];
const Glob = ["favicon.ico", "index.html"];
module.exports = {
entry: {
jsonToHtml: "./src/JsonToHtml.js",
treeHelpers: "./src/TreeHelpers.js"
},
output: {
path: __dirname + "/dist/js/",
filename: "[name].bundle.js"
},
plugins: [
new CopyWebpackPlugin(
Npm.map(asset => {
return {
from: path.resolve(__dirname, `./node_modules/${asset}`),
to: path.resolve(__dirname, './dist/js/npm')
};
}).concat(Less.map(asset => {
return {
from: path.resolve(__dirname, `./styles/${asset}`),
to: path.resolve(__dirname, './dist/styles')
};
})).concat(Data.map(asset => {
return {
from: path.resolve(__dirname, `./data/${asset}`),
to: path.resolve(__dirname, './dist/data')
};
})).concat(Glob.map(asset => {
return {
from: path.resolve(__dirname, `./${asset}`),
to: path.resolve(__dirname, './dist')
};
}))
)
]
};