-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
39 lines (34 loc) · 1.02 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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var neat = require('node-neat').includePaths;
var sassNeatPaths = require("node-neat").includePaths.map(function(sassPath) {
return "includePaths[]=" + sassPath;
}).join("&");
var config = {
entry: {
app: [
'./app/Router.js'
],
vendor: [
'react',
'firebase'
]
},
output: {
path: './public',
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.(js|jsx)$/, loaders: ['jsx', 'babel'], exclude: /node_modules/},
{ test: /\.scss$/, loaders: [ExtractTextPlugin.extract("css"), 'css', 'sass?' + sassNeatPaths] },
{ test: /\.css$/, loader: ExtractTextPlugin.extract("css") }
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new ExtractTextPlugin("bundle.css")
]
};
module.exports = config;