Deleting references to 'react-hot-loader/webpack' and 'react-hot-loader/patch' as it was removed in v4 of react-hot-loader. Bumping peer dependency of webpack to 3 and 4
This commit is contained in:
Родитель
78a8bbf783
Коммит
59ca023f46
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "aspnet-webpack-react",
|
||||
"version": "3.0.0",
|
||||
"version": "4.0.0",
|
||||
"description": "Helpers for using Webpack with React in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -17,12 +17,12 @@
|
|||
"url": "https://github.com/aspnet/JavaScriptServices.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/webpack": "^2.2.0",
|
||||
"@types/webpack": "^4.4.0",
|
||||
"rimraf": "^2.5.4",
|
||||
"typescript": "^2.0.0",
|
||||
"webpack": "^2.2.0"
|
||||
"webpack": "^4.16.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"webpack": "^2.2.0"
|
||||
"webpack": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import * as webpack from 'webpack';
|
||||
|
||||
const reactHotLoaderWebpackLoader = 'react-hot-loader/webpack';
|
||||
const reactHotLoaderPatch = 'react-hot-loader/patch';
|
||||
const supportedTypeScriptLoaders = ['ts-loader', 'awesome-typescript-loader'];
|
||||
|
||||
export function addReactHotModuleReplacementConfig(webpackConfig: webpack.Configuration) {
|
||||
|
@ -27,12 +25,6 @@ export function addReactHotModuleReplacementConfig(webpackConfig: webpack.Config
|
|||
continue;
|
||||
}
|
||||
|
||||
// This is the one - prefix it with the react-hot-loader loader
|
||||
// (unless it's already in there somewhere)
|
||||
if (!containsLoader(loadersArray, reactHotLoaderWebpackLoader)) {
|
||||
loadersArray.unshift(reactHotLoaderWebpackLoader);
|
||||
rule.use = loadersArray; // In case we normalised it to an array
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -48,11 +40,6 @@ export function addReactHotModuleReplacementConfig(webpackConfig: webpack.Config
|
|||
// Normalise to array
|
||||
entryConfig[entrypointName] = [entryConfig[entrypointName] as string];
|
||||
}
|
||||
|
||||
let entryValueArray = entryConfig[entrypointName] as string[];
|
||||
if (entryValueArray.indexOf(reactHotLoaderPatch) < 0) {
|
||||
entryValueArray.unshift(reactHotLoaderPatch);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче