-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
34 lines (32 loc) · 966 Bytes
/
webpack.config.dev.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
import path from 'path';
// Bundling - Compiler
export default {
// Sets node env to dev
mode: 'development',
// Grants ability to debug compiled code
// https://webpack.js.org/configuration/devtool/
devtool: 'eval-source-map',
// Apps Entry point to bundle up code
entry: './src/index.js',
// Location of bundled up code (Will not create file in dev mode)
output: {
path: path.resolve(__dirname, 'src'),
publicPath: '/',
filename: 'bundle.js'
},
// Plugins to enhance webpack
plugins: [
// Create HTML file that includes reference to bundled js
new HtmlWebpackPlugin({
template: 'src/index.html'
})
],
// How to handle different file types, granting ability to import files
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] }
]
}
};