Skip to content

Commit 393325f

Browse files
committed
Clean up configs
1 parent a34cf3b commit 393325f

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

webpack.build.config.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,10 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
44
const BabiliPlugin = require('babili-webpack-plugin')
55
const ExtractTextPlugin = require('extract-text-webpack-plugin')
66

7-
// Config directories
8-
const SRC_DIR = path.resolve(__dirname, 'src')
9-
const OUTPUT_DIR = path.resolve(__dirname, 'dist')
10-
117
// Any directories you will be adding code/files into, need to be added to this array so webpack will pick them up
12-
const defaultInclude = [SRC_DIR]
8+
const defaultInclude = path.resolve(__dirname, 'src')
139

1410
module.exports = {
15-
entry: SRC_DIR + '/index.js',
16-
output: {
17-
path: OUTPUT_DIR,
18-
publicPath: './',
19-
filename: 'bundle.js'
20-
},
2111
module: {
2212
rules: [
2313
{

webpack.dev.config.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,10 @@ const path = require('path')
33
const HtmlWebpackPlugin = require('html-webpack-plugin')
44
const { spawn } = require('child_process')
55

6-
// Config directories
7-
const SRC_DIR = path.resolve(__dirname, 'src')
8-
const OUTPUT_DIR = path.resolve(__dirname, 'dist')
9-
106
// Any directories you will be adding code/files into, need to be added to this array so webpack will pick them up
11-
const defaultInclude = [SRC_DIR]
7+
const defaultInclude = path.resolve(__dirname, 'src')
128

139
module.exports = {
14-
entry: SRC_DIR + '/index.js',
15-
output: {
16-
path: OUTPUT_DIR,
17-
publicPath: '/',
18-
filename: 'bundle.js'
19-
},
2010
module: {
2111
rules: [
2212
{
@@ -50,7 +40,7 @@ module.exports = {
5040
],
5141
devtool: 'cheap-source-map',
5242
devServer: {
53-
contentBase: OUTPUT_DIR,
43+
contentBase: path.resolve(__dirname, 'dist'),
5444
stats: {
5545
colors: true,
5646
chunks: false,

0 commit comments

Comments
 (0)