From 481ca0a8e01414de23d9c87ca1f0521e47a0dc65 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Thu, 9 Feb 2017 15:43:41 +0000 Subject: [PATCH] Replace 'loader' with 'use' in various Webpack configs. Fixes 'loader option has been deprecated' warnings. --- templates/Angular2Spa/webpack.config.vendor.js | 2 +- templates/KnockoutSpa/webpack.config.js | 6 +++--- templates/KnockoutSpa/webpack.config.vendor.js | 2 +- templates/ReactReduxSpa/webpack.config.js | 2 +- templates/ReactReduxSpa/webpack.config.vendor.js | 2 +- templates/ReactSpa/webpack.config.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/Angular2Spa/webpack.config.vendor.js b/templates/Angular2Spa/webpack.config.vendor.js index 35318959b0..3b507ead78 100644 --- a/templates/Angular2Spa/webpack.config.vendor.js +++ b/templates/Angular2Spa/webpack.config.vendor.js @@ -51,7 +51,7 @@ module.exports = (env) => { output: { path: path.join(__dirname, 'wwwroot', 'dist') }, module: { rules: [ - { test: /\.css(\?|$)/, use: extractCSS.extract({ loader: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } ] }, plugins: [ diff --git a/templates/KnockoutSpa/webpack.config.js b/templates/KnockoutSpa/webpack.config.js index 281b286d9f..10aad9966a 100644 --- a/templates/KnockoutSpa/webpack.config.js +++ b/templates/KnockoutSpa/webpack.config.js @@ -18,9 +18,9 @@ module.exports = (env) => { module: { rules: [ { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, - { test: /\.html$/, loader: 'raw-loader' }, - { test: /\.css$/, loader: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract({ loader: 'css-loader' }) }, - { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader?limit=25000' } + { test: /\.html$/, use: 'raw-loader' }, + { test: /\.css$/, use: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, plugins: [ diff --git a/templates/KnockoutSpa/webpack.config.vendor.js b/templates/KnockoutSpa/webpack.config.vendor.js index 710459e52c..48c08af602 100644 --- a/templates/KnockoutSpa/webpack.config.vendor.js +++ b/templates/KnockoutSpa/webpack.config.vendor.js @@ -13,7 +13,7 @@ module.exports = (env) => { module: { rules: [ { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }, - { test: /\.css(\?|$)/, use: extractCSS.extract({ loader: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } ] }, entry: { diff --git a/templates/ReactReduxSpa/webpack.config.js b/templates/ReactReduxSpa/webpack.config.js index a88ff55188..4a09f5a13b 100644 --- a/templates/ReactReduxSpa/webpack.config.js +++ b/templates/ReactReduxSpa/webpack.config.js @@ -30,7 +30,7 @@ module.exports = (env) => { entry: { 'main-client': './ClientApp/boot-client.tsx' }, module: { rules: [ - { test: /\.css$/, use: ExtractTextPlugin.extract({ loader: 'css-loader' }) }, + { test: /\.css$/, use: ExtractTextPlugin.extract({ use: 'css-loader' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] }, diff --git a/templates/ReactReduxSpa/webpack.config.vendor.js b/templates/ReactReduxSpa/webpack.config.vendor.js index b222133123..54c4f7d0ff 100644 --- a/templates/ReactReduxSpa/webpack.config.vendor.js +++ b/templates/ReactReduxSpa/webpack.config.vendor.js @@ -50,7 +50,7 @@ module.exports = (env) => { output: { path: path.join(__dirname, 'wwwroot', 'dist') }, module: { rules: [ - { test: /\.css(\?|$)/, use: extractCSS.extract({ loader: 'css-loader' }) } + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } ] }, plugins: [ diff --git a/templates/ReactSpa/webpack.config.js b/templates/ReactSpa/webpack.config.js index 2831bcbf31..de3276370f 100644 --- a/templates/ReactSpa/webpack.config.js +++ b/templates/ReactSpa/webpack.config.js @@ -19,7 +19,7 @@ module.exports = (env) => { rules: [ { test: /\.ts(x?)$/, include: /ClientApp/, use: 'babel-loader' }, { test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, - { test: /\.css$/, loader: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract({ loader: 'css-loader' }) }, + { test: /\.css$/, use: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract({ use: 'css-loader' }) }, { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } ] },