-
Notifications
You must be signed in to change notification settings - Fork 176
/
Copy pathwebpack.config.js
68 lines (65 loc) · 2.23 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
var path = require("path"),
webpack = require("webpack"),
ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
cache: true,
debug: true,
devtool: 'inline-source-map',
sourceMapFileName: "[file].map",
context: path.join(__dirname, "/src/client"),
entry: {
main: "./main",
webworker: "./models/webworker"
},
output: {
path: "./public/js/",
filename: "[name].js",
chunkFilename: "[id].js",
sourceMapFilename: "[name].map",
publicPath: "/js/"
},
module: {
loaders: [
{ test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' },
// required to write "require('./style.scss')"
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("css?sourceMap!sass?sourceMap")
},
{ test: /\.png$/, loader: "url-loader?mimetype=image/png" },
{ test: /\.gif$/, loader: "url-loader?mimetype=image/gif" },
// required for bootstrap icons
{ test: /\.(woff|woff2)$/, loader: "url-loader?prefix=font/&limit=5000&mimetype=application/font-woff" },
{ test: /\.ttf$/, loader: "file-loader?prefix=font/" },
{ test: /\.eot$/, loader: "file-loader?prefix=font/" },
{ test: /\.svg$/, loader: "file-loader?prefix=font/" },
// required for react jsx
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ['es2015', 'react']
}
},
// required for GLSL support
{ test: /\.glsl$/, loader: 'webpack-glsl' }
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.scss'],
alias: {
underscore : "lodash"
}
},
plugins: [
new webpack.ProvidePlugin({
"_": "lodash",
"$": "jquery",
"jQuery": "jquery",
"Backbone": "backbone",
"THREE": "three"
})
,new ExtractTextPlugin("[name].css")
]
};