-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (47 loc) · 1.41 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
'use strict';
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
module.exports = {
context: __dirname + '/src',
entry: {
'js/app':"./scripts/app.js",
'style/style':"./style/style.scss"
},
output: {
path: __dirname + '/public',
filename: "[name].js"
},
resolve:{
extensions: ['', '.js', '.scss', '.png']
},
module: {
loaders: [
{
test: /\.js$/,
exclude: path.join(__dirname, 'src/style'),
loaders: ["react-hot", "babel?presets[]=react,presets[]=es2015,plugins[]=transform-object-rest-spread"]
},
{
test: /\.scss$/,
exclude: 'img',
loader: ExtractTextPlugin.extract("css!postcss!sass")
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'file?name=img/[name].[ext]'
}
]
},
postcss:[ autoprefixer({browsers: ['last 2 versions']})],
resolveLoader:{
modulesDirectories: ['node_modules'],
moduleTemplates: ['*-loader','*'],
extensions: ['','.js']
},
plugins: [
new ExtractTextPlugin('[name].css', {allChunks: true})
],
watch: true
};