Skip to content

Commit

Permalink
docs(samples-webpack): updated config and dependencies (#8184)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATran31 authored Sep 21, 2022
1 parent 6c03465 commit 82e3290
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
20 changes: 10 additions & 10 deletions docs/samples/webpack-getting-started/_sample_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
12 changes: 5 additions & 7 deletions docs/samples/webpack-getting-started/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -19,7 +19,7 @@ module.exports = {
test: /\.yaml$/,
use: [
{ loader: 'json-loader' },
{ loader: 'yaml-loader' }
{ loader: 'yaml-loader', options:{ asJSON: true } }
]
},
{
Expand All @@ -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'
})
Expand Down

0 comments on commit 82e3290

Please sign in to comment.