-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
67 lines (66 loc) · 1.67 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var postCSS = {
nested: require('postcss-nested'),
autoprefixer: require('autoprefixer-core'),
variables: require('postcss-css-variables'),
import: require('postcss-import')
};
module.exports = {
resolve: {
extensions: ['', '.js', '.jsx'],
packageAlias: "browser",
},
entry: [
'./client'
],
output: {
path: path.join(__dirname, 'public', 'js'),
filename: 'app.js',
},
plugins: [
new ExtractTextPlugin('../css/styles.css')
],
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel-loader'],
// TODO: this is fugly, figure out better way to prevent
// 'npm link':ed modules from causing problems
include: [
path.join(__dirname, 'client.js'),
path.join(__dirname, 'options.js'),
path.join(__dirname, 'routes.js'),
path.join(__dirname, 'stores.js'),
path.join(__dirname, 'components'),
path.join(__dirname, 'config'),
path.join(__dirname, 'stores')
],
exclude: [/node_modules/]
},
{
test: /\.json$/,
loader: "json-loader"
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
},
{
test: /\.(ttf|eot|svg|woff(2)?)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader?name=../[path][name].[ext]"
}
]
},
postcss: {
defaults: [
postCSS.import({
path: ['node_modules']
}),
postCSS.nested,
postCSS.autoprefixer
]
}
};