-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
59 lines (57 loc) · 1.94 KB
/
webpack.config.js
File metadata and controls
59 lines (57 loc) · 1.94 KB
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
'use strict';
var path = require('path'),
webpack = require("webpack");
module.exports = {
devtool: '#source-map',
resolve: {
root: [path.join(__dirname, "bower_components")],
extensions: ['', '.js', '.jsx']
},
plugins: [
new webpack.ResolverPlugin(
[new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])],
["normal", "loader"]
),
new webpack.ProvidePlugin({
$: "jquery/dist/jquery.min",
jQuery: "jquery/dist/jquery.min",
"windows.jQuery": "jquery/dist/jquery.min",
_: "underscore",
React: 'react'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.scss$/, loader: "style!css!sass?outputStyle=expanded" },
{ test: /\.gif$/, loader: 'url?limit=150000&mimetype=image/gif' },
{ test: /\.png$/, loader: 'url?limit=150000&mimetype=image/png' },
{ test: /\.jpg$/, loader: 'file' },
{ test: /\.json$/, loader: 'json' },
{ test: /\.svg$/, loader: 'url?mimetype=image/svg+xml' },
{ test: /\.woff2?$/, loader: 'url?mimetype=application/font-woff' },
{ test: /\.eot$/, loader: 'url?mimetype=application/font-woff' },
{ test: /\.ttf$/, loader: 'url?mimetype=application/font-woff' },
{ test: /\.jsx?$/, loaders: ['react-hot', 'jsx?harmony'], exclude: /node_modules/ },
{ test: /\Modernizr.js$/, loader: 'imports?this=>global' },
]
},
entry: {
all: [
"./app/assets/javascript/default",
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
]
},
output: {
path: __dirname + '/dist/assets/javascript/',
filename: "[name].bundle.js",
publicPath: '/assets/javascript/',
chunkFilename: "[id].bundle.js"
},
debug: true,
watch: true,
watchDelay: 200,
}