-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.babel.js
47 lines (46 loc) · 1.27 KB
/
webpack.config.babel.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
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
import path from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
export default {
context: __dirname,
entry: './index.jsx',
output: {
path: `${__dirname}/__dev__`,
publicPath: '/',
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
},
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.scss$/, loaders: [
'style-loader',
'css-loader',
'sass-loader?includePaths[]=' + path.resolve(__dirname, './node_modules/compass-mixins/lib')
]},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
plugins: [
new CopyWebpackPlugin([
{ from: '404.html' },
{ from: 'img', to: 'img' },
{ from: 'fonts', to: 'fonts' }
]),
new HtmlWebpackPlugin({
template: 'index.template.ejs',
inject: 'body'
}),
],
};