forked from jaredly/treed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (36 loc) · 975 Bytes
/
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
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var fs = require('fs')
, path = require('path')
var dirs = fs.readdirSync(__dirname).filter(function (name) {
return fs.statSync(path.join(__dirname, name)).isDirectory()
})
var entries = {}
dirs.forEach(function (name) {
entries[name] = './' + name + '/index.js'
})
module.exports = {
entry: entries,
output: {
path: './',
filename: '[name]/build.js',
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?optional=runtime' },
{ test: /\.json$/, loader: 'json' },
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
}
],
},
devtool: 'eval',
colors: true,
plugins: [
new ExtractTextPlugin("[name]/build.css")
],
}