@@ -3,7 +3,9 @@ const utils = require('./utils')
33const webpack = require ( 'webpack' )
44const config = require ( '../config' )
55const merge = require ( 'webpack-merge' )
6+ const path = require ( 'path' )
67const baseWebpackConfig = require ( './webpack.base.conf' )
8+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' )
79const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
810const FriendlyErrorsPlugin = require ( 'friendly-errors-webpack-plugin' )
911const portfinder = require ( 'portfinder' )
@@ -23,6 +25,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
2325 clientLogLevel : 'warning' ,
2426 historyApiFallback : true ,
2527 hot : true ,
28+ contentBase : false , // since we use CopyWebpackPlugin.
2629 compress : true ,
2730 host : HOST || config . dev . host ,
2831 port : PORT || config . dev . port ,
@@ -50,6 +53,14 @@ const devWebpackConfig = merge(baseWebpackConfig, {
5053 template : 'index.html' ,
5154 inject : true
5255 } ) ,
56+ // copy custom static assets
57+ new CopyWebpackPlugin ( [
58+ {
59+ from : path . resolve ( __dirname , '../static' ) ,
60+ to : config . dev . assetsSubDirectory ,
61+ ignore : [ '.*' ]
62+ }
63+ ] )
5364 ]
5465} )
5566
0 commit comments