-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (44 loc) · 1.11 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
'use strict';
var fs = require('fs');
var path = require('path');
// var ExtractTextPlugin = require('extract-text-webpack-plugin');
var entries = function(basePath) {
var entry = {},
projectDirs = fs.readdirSync(basePath);
projectDirs.forEach(function(projectDir) {
var stats = fs.statSync(basePath + '/' + projectDir);
if (stats.isDirectory()) {
var files = fs.readdirSync(basePath + '/' + projectDir);
files.forEach(function(file) {
if (file.indexOf('entry.js') != -1) {
entry[projectDir + '/' + file.replace('.js', '')] = basePath + '/' + projectDir + '/' + file;
}
});
}
});
return entry;
}
module.exports = {
entry: entries('./js'),
output: {
filename: '[name].js',
// publicPath: "/dist/",
path: __dirname + '/dist/js/'
},
module: {
loaders: [{
test: /\.(js|jsx|es6)$/,
loader: 'babel',
query: {
presets: ['es2015']
}
}, {
test: /\.scss$/,
loader: 'style!css!scss'
}]
},
plugins: [
// new ExtractTextPlugin("styles.css"),
// new ExtractTextPlugin("[name].css")
]
}