-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (46 loc) · 1.34 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
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer');
module.exports = {
context: __dirname + '/src',
devtool: 'source-map',
entry: './entry.js',
output: {
path: __dirname + '/dist',
filename: 'ham-toastie.js'
},
plugins: [
new CopyWebpackPlugin([
{ from: './index.html', to: 'index.html' }
]),
new ExtractTextPlugin('ham-toastie.css')
],
module: {
preLoaders: [
{
test: /\.js$/,
loaders: ['eslint'],
include: __dirname + '/src/js'
}
],
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss?browsers=last 2 versions!sass')
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel', // Automatically generates source maps without the sourceMaps config
query: {
presets: ['es2015']
}
}
],
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ]
},
eslint: {
failOnWarning: false,
failOnError: false
}
};