@@ -5,6 +5,7 @@ var webpack = require('webpack');
5
5
var autoprefixer = require ( 'autoprefixer' ) ;
6
6
var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
7
7
var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
8
+ var CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
8
9
9
10
module . exports = function makeWebpackConfig ( ENV ) {
10
11
/**
@@ -149,9 +150,10 @@ module.exports = function makeWebpackConfig (ENV) {
149
150
// Render index.html
150
151
config . plugins . push (
151
152
new HtmlWebpackPlugin ( {
152
- template : './src/index.html' ,
153
+ template : './src/public/ index.html' ,
153
154
inject : 'body'
154
155
} ) ,
156
+
155
157
// Reference: https://github.com/webpack/extract-text-webpack-plugin
156
158
// Extract css files
157
159
// Disabled when in test mode or not in build mode
@@ -172,7 +174,13 @@ module.exports = function makeWebpackConfig (ENV) {
172
174
173
175
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
174
176
// 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
+ } ] )
176
184
)
177
185
}
178
186
@@ -182,7 +190,7 @@ module.exports = function makeWebpackConfig (ENV) {
182
190
* Reference: http://webpack.github.io/docs/webpack-dev-server.html
183
191
*/
184
192
config . devServer = {
185
- contentBase : './public' ,
193
+ contentBase : './src/ public' ,
186
194
stats : {
187
195
modules : false ,
188
196
cached : false ,
0 commit comments