-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (29 loc) · 906 Bytes
/
webpack.config.js
File metadata and controls
33 lines (29 loc) · 906 Bytes
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
var webpack = require('webpack');
var path = require('path');
var htmlPlugin = require('html-webpack-plugin');
var SRC = path.resolve(__dirname, 'src');
var OUT = path.resolve(__dirname, 'build');
var html = new htmlPlugin({
hash: true,
template: 'src/index.html',
favicon: 'src/favicon.ico'
});
var config = {
entry: SRC + '/index.js',
output: {
path: OUT,
filename: 'app/bundle.js',
publicPath: '/'
},
module: {
rules: [
{ test: /\.js?/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.scss?/, exclude: /node_modules/, loader: ['style-loader','css-loader','sass-loader'] },
{ test: /\.(png|svg)$/, use: [{ loader: 'file-loader', options: { name: 'assets/[name]-[hash].[ext]'}}] }
]
},
plugins: [
html
]
};
module.exports = config;