Skip to content

Commit

Permalink
Fix static file serving for publicPath != / (fix#1176) (#1180)
Browse files Browse the repository at this point in the history
* Batman!

* fix typo
  • Loading branch information
LinusBorg committed Dec 27, 2017
1 parent 3f232bf commit b30c4aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions template/build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
Expand All @@ -23,6 +25,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
clientLogLevel: 'warning',
historyApiFallback: true,
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
Expand Down Expand Up @@ -50,6 +53,14 @@ const devWebpackConfig = merge(baseWebpackConfig, {
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})

Expand Down

0 comments on commit b30c4aa

Please sign in to comment.