mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Fix Webpack default entry issue: webpackConfig.entry.main.unshift is not a function
Closes #56
This commit is contained in:
@@ -40,7 +40,11 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
|
|||||||
// Build the final Webpack config based on supplied options
|
// Build the final Webpack config based on supplied options
|
||||||
if (enableHotModuleReplacement) {
|
if (enableHotModuleReplacement) {
|
||||||
// TODO: Stop assuming there's an entry point called 'main'
|
// TODO: Stop assuming there's an entry point called 'main'
|
||||||
|
if (typeof webpackConfig.entry['main'] === 'string') {
|
||||||
|
webpackConfig.entry['main'] = ['webpack-hot-middleware/client', webpackConfig.entry['main']];
|
||||||
|
} else {
|
||||||
webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');
|
webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');
|
||||||
|
}
|
||||||
webpackConfig.plugins.push(
|
webpackConfig.plugins.push(
|
||||||
new webpack.HotModuleReplacementPlugin()
|
new webpack.HotModuleReplacementPlugin()
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user