This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
91 lines (80 loc) · 2.27 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var local = require('./local');
require('babel-polyfill');
module.exports = {
devtool: 'eval',
entry: {
home: "./client/home",
error: "./client/error",
vendor: ["./materialize.config.scss", "jquery", "react", "react-dom", "materialize-css", "reflux", "reflux-state-mixin", "debug", "superagent", "classnames", "intl"],
locales: ["./services/locales"],
clientconfig: ["./clientconfig"]
},
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.jsx', '.json']
},
output: {
path: local.publicFilePath,
publicPath: '/public/',
filename: "[name].js"
},
node: {
fs: "empty",
i18n: 'empty',
net: "empty",
tls: "empty"
},
module: {
loaders: [
{
test: /\.json$/,
loader: 'json'
},{
test: /\.(glsl|vert|frag)([\?]?.*)$/,
loader: 'raw'
},{
test: /\.jsx?$/,
loader: 'babel-loader',
include: [/i18n\.js/, /locales/, /views/, /components/, /stores/, /actions/, /services/, /client/, /react-slick/, /reflux-state-mixin/],
query: {
presets: [
"es2015",
"react",
"stage-0"
],
plugins: ['transform-flow-strip-types']
}
},
{test: /\.(scss|css)$/, loader: ExtractTextPlugin.extract('style-loader', "css!resolve-url!sass")},
{test: /\.(woff|svg|ttf|eot|gif)([\?]?.*)$/, loader: "file-loader?name=[name].[ext]"}
],
noParse: [
'/node_modules\/json-schema\/lib\/validate\.js/' //https://github.com/request/request/issues/1920
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
Materialize: "materialize-css",
"window.Materialize": "materialize-css"
}),
new webpack.optimize.CommonsChunkPlugin({
names: ["clientconfig", "locales", "vendor"],
minChunks: Infinity
}),
new ExtractTextPlugin("[name].css"),
new webpack.IgnorePlugin(/^(i18n|winston|winston-loggly)$/),
new webpack.DefinePlugin({
'process.env': {
APP_ENV: JSON.stringify('browser')
}
})
],
externals: {
'unicode/category/So': '{}'
}
};