-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
31 lines (30 loc) · 1003 Bytes
/
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
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: path.resolve(__dirname,'source/index.js'),
output: {
path: path.resolve(__dirname,'build'),
filename: 'app.js'
},
module: {
loaders: [
{ test: /\.json$/, include: /node_modules/, loader: "json-loader" },
{ test: /\.js$/, exclude: /node_modules|bower_components/, loader: 'babel-loader', query: {presets: ['es2015']}},
{ test: /\.jsx$/, exclude: /node_modules/, loader: 'babel-loader', query: {presets: ['es2015']} },
{ test: /\.(png|jpg|svg)$/, loader: 'file-loader?' },
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style", "css!sass"),
}
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'source/index.html',
filename: 'index.html'
}),
new ExtractTextPlugin("styles.css")
],
}