2016-03-28 17:53:30 -04:00
|
|
|
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
var path = require('path');
|
|
|
|
|
2016-07-12 16:45:22 -04:00
|
|
|
var routes = require('./src/routes.json');
|
2016-04-08 12:38:50 -04:00
|
|
|
|
|
|
|
// Prepare all entry points
|
2016-04-17 23:16:32 -04:00
|
|
|
var entry = {};
|
2016-04-08 12:38:50 -04:00
|
|
|
routes.forEach(function (route) {
|
|
|
|
entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx';
|
|
|
|
});
|
|
|
|
|
2016-03-28 17:53:30 -04:00
|
|
|
module.exports = {
|
2016-09-02 11:39:18 -04:00
|
|
|
entry: entry,
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'build'),
|
|
|
|
filename: 'js/[name].bundle.js'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [{
|
|
|
|
test: /\.jsx$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
include: path.resolve(__dirname, 'src'),
|
|
|
|
query: {
|
|
|
|
presets: ['es2015', 'react']
|
2016-03-28 17:53:30 -04:00
|
|
|
}
|
2016-09-02 11:39:18 -04:00
|
|
|
}, {
|
|
|
|
test: /\.scss$/,
|
|
|
|
loader: 'style!css!postcss-loader!sass'
|
|
|
|
}, {
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json-loader'
|
|
|
|
}, {
|
|
|
|
test: /\.css$/,
|
|
|
|
loader: 'style!css!postcss-loader'
|
|
|
|
}, {
|
|
|
|
test: /\.(png|jpg|gif|eot|svg|ttf|woff)$/,
|
|
|
|
loader: 'url-loader'
|
|
|
|
}, {
|
|
|
|
test: /\.less$/,
|
|
|
|
loader: 'style!css!less'
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CopyWebpackPlugin([{
|
|
|
|
from: 'static'
|
|
|
|
}])
|
|
|
|
]
|
|
|
|
};
|