@@ -5,6 +5,7 @@ var webpack = require('webpack');
55var autoprefixer = require ( 'autoprefixer' ) ;
66var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
77var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
8+ var CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
89
910module . exports = function makeWebpackConfig ( ENV ) {
1011 /**
@@ -149,9 +150,10 @@ module.exports = function makeWebpackConfig (ENV) {
149150 // Render index.html
150151 config . plugins . push (
151152 new HtmlWebpackPlugin ( {
152- template : './src/index.html' ,
153+ template : './src/public/ index.html' ,
153154 inject : 'body'
154155 } ) ,
156+
155157 // Reference: https://github.com/webpack/extract-text-webpack-plugin
156158 // Extract css files
157159 // Disabled when in test mode or not in build mode
@@ -172,7 +174,13 @@ module.exports = function makeWebpackConfig (ENV) {
172174
173175 // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
174176 // Minify all javascript, switch loaders to minimizing mode
175- new webpack . optimize . UglifyJsPlugin ( )
177+ new webpack . optimize . UglifyJsPlugin ( ) ,
178+
179+ // Copy assets from the public folder
180+ // Reference: https://github.com/kevlened/copy-webpack-plugin
181+ new CopyWebpackPlugin ( [ {
182+ from : __dirname + '/src/public'
183+ } ] )
176184 )
177185 }
178186
@@ -182,7 +190,7 @@ module.exports = function makeWebpackConfig (ENV) {
182190 * Reference: http://webpack.github.io/docs/webpack-dev-server.html
183191 */
184192 config . devServer = {
185- contentBase : './public' ,
193+ contentBase : './src/ public' ,
186194 stats : {
187195 modules : false ,
188196 cached : false ,
0 commit comments