@@ -3,7 +3,9 @@ const utils = require('./utils')
3
3
const webpack = require ( 'webpack' )
4
4
const config = require ( '../config' )
5
5
const merge = require ( 'webpack-merge' )
6
+ const path = require ( 'path' )
6
7
const baseWebpackConfig = require ( './webpack.base.conf' )
8
+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' )
7
9
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
8
10
const FriendlyErrorsPlugin = require ( 'friendly-errors-webpack-plugin' )
9
11
const portfinder = require ( 'portfinder' )
@@ -23,6 +25,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
23
25
clientLogLevel : 'warning' ,
24
26
historyApiFallback : true ,
25
27
hot : true ,
28
+ contentBase : false , // since we use CopyWebpackPlugin.
26
29
compress : true ,
27
30
host : HOST || config . dev . host ,
28
31
port : PORT || config . dev . port ,
@@ -50,6 +53,14 @@ const devWebpackConfig = merge(baseWebpackConfig, {
50
53
template : 'index.html' ,
51
54
inject : true
52
55
} ) ,
56
+ // copy custom static assets
57
+ new CopyWebpackPlugin ( [
58
+ {
59
+ from : path . resolve ( __dirname , '../static' ) ,
60
+ to : config . dev . assetsSubDirectory ,
61
+ ignore : [ '.*' ]
62
+ }
63
+ ] )
53
64
]
54
65
} )
55
66
0 commit comments