From 82e3290de4acd6c13f24caf15c68790fa8b5dcf1 Mon Sep 17 00:00:00 2001 From: An Tran Date: Wed, 21 Sep 2022 19:06:52 -0400 Subject: [PATCH] docs(samples-webpack): updated config and dependencies (#8184) --- .../_sample_package.json | 20 +++++++++---------- .../webpack-getting-started/webpack.config.js | 12 +++++------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/docs/samples/webpack-getting-started/_sample_package.json b/docs/samples/webpack-getting-started/_sample_package.json index 484f560f9d7..74d65663e4d 100644 --- a/docs/samples/webpack-getting-started/_sample_package.json +++ b/docs/samples/webpack-getting-started/_sample_package.json @@ -9,18 +9,18 @@ "author": "Shaun Luttin", "license": "Apache-2.0", "devDependencies": { - "clean-webpack-plugin": "^1.0.1", - "copy-webpack-plugin": "^4.6.0", - "html-webpack-plugin": "^3.2.0", - "webpack": "^4.29.3", - "webpack-cli": "^3.2.3", - "webpack-dev-server": "^3.1.14" + "clean-webpack-plugin": "^4.0.0", + "copy-webpack-plugin": "^11.0.0", + "html-webpack-plugin": "^5.5.0", + "webpack": "^5.74.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.11.0" }, "dependencies": { - "css-loader": "^2.1.0", + "css-loader": "^6.7.1", "json-loader": "^0.5.7", - "style-loader": "^0.23.1", - "swagger-ui": "^3.20.7", - "yaml-loader": "^0.5.0" + "style-loader": "^3.3.1", + "swagger-ui": "^4.14.0", + "yaml-loader": "^0.8.0" } } diff --git a/docs/samples/webpack-getting-started/webpack.config.js b/docs/samples/webpack-getting-started/webpack.config.js index 5240bf65af1..9ea2913f4ba 100644 --- a/docs/samples/webpack-getting-started/webpack.config.js +++ b/docs/samples/webpack-getting-started/webpack.config.js @@ -1,6 +1,6 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const outputPath = path.resolve(__dirname, 'dist'); @@ -19,7 +19,7 @@ module.exports = { test: /\.yaml$/, use: [ { loader: 'json-loader' }, - { loader: 'yaml-loader' } + { loader: 'yaml-loader', options:{ asJSON: true } } ] }, { @@ -32,17 +32,15 @@ module.exports = { ] }, plugins: [ - new CleanWebpackPlugin([ - outputPath - ]), - new CopyWebpackPlugin([ + new CleanWebpackPlugin(), + new CopyWebpackPlugin({patterns:[ { // Copy the Swagger OAuth2 redirect file to the project root; // that file handles the OAuth2 redirect after authenticating the end-user. from: require.resolve('swagger-ui/dist/oauth2-redirect.html'), to: './' } - ]), + ]}), new HtmlWebpackPlugin({ template: 'index.html' })