-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.config.js
54 lines (49 loc) · 1.29 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
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ModernizrWebpackPlugin = require('modernizr-webpack-plugin');
var modernizrConfig = {
'filename': 'js/modernizr-bundle.js',
'feature-detects': [
'inputtypes'
]
}
module.exports = {
devtool: 'eval',
context: __dirname + "/app/js",
entry: "./app.jsx",
output: {
filename: "assets/javascripts/app_bundle.js",
path:__dirname + '/app'
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.js', '.jsx']
},
module: {
// Load the react-hot-loader
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: ['babel-loader?presets[]=es2015&presets[]=react']
},
// Extract css files
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
// Optionally extract less files
// or any other compile-to-css language
{
test: /\.less$/,
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
{
test: /\.(jpg|png|svg)$/,
loader: 'url-loader'
}
]
},
plugins: [
new ModernizrWebpackPlugin(modernizrConfig),
new ExtractTextPlugin("assets/stylesheets/app_bundle.css")
]
};