-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathwebpack.config.js
More file actions
34 lines (32 loc) · 892 Bytes
/
webpack.config.js
File metadata and controls
34 lines (32 loc) · 892 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
34
'use strict';
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = ({ lastStyleLoader = 'style-loader' } = {}) => ({
mode: 'development',
entry: ['babel-polyfill', './src/index.jsx'],
devtool: 'source-map',
output: {
filename: '[name].[hash].js',
},
devServer: {
static: {
directory: __dirname,
},
},
module: {
rules: [
{ test: /\.jsx?$/, include: path.resolve('./src'), use: 'babel-loader' },
{
test: /\.s?css$/,
include: path.resolve('./src'),
use: [lastStyleLoader, 'css-loader', 'postcss-loader', 'sass-loader'],
},
{
test: /\.mp3$/,
include: path.resolve('./src'),
use: 'file-loader',
},
],
},
plugins: [new HtmlWebpackPlugin({ template: './src/index.template.html' })],
});