Skip to content

Commit e315bd2

Browse files
Merge pull request aspnet#57 from laskoviymishka/unshift-issue
Fix issue: entry.main.unshift is not a function Closes aspnet#56
2 parents ad4bf09 + 754e32b commit e315bd2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Microsoft.AspNet.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export function createWebpackDevServer(callback: CreateDevServerCallback, option
4040
// Build the final Webpack config based on supplied options
4141
if (enableHotModuleReplacement) {
4242
// TODO: Stop assuming there's an entry point called 'main'
43-
webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');
43+
if (typeof webpackConfig.entry['main'] === 'string') {
44+
webpackConfig.entry['main'] = ['webpack-hot-middleware/client', webpackConfig.entry['main']];
45+
} else {
46+
webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');
47+
}
4448
webpackConfig.plugins.push(
4549
new webpack.HotModuleReplacementPlugin()
4650
);

0 commit comments

Comments
 (0)