Skip to content

Commit 82e3290

Browse files
authored
docs(samples-webpack): updated config and dependencies (#8184)
1 parent 6c03465 commit 82e3290

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

docs/samples/webpack-getting-started/_sample_package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"author": "Shaun Luttin",
1010
"license": "Apache-2.0",
1111
"devDependencies": {
12-
"clean-webpack-plugin": "^1.0.1",
13-
"copy-webpack-plugin": "^4.6.0",
14-
"html-webpack-plugin": "^3.2.0",
15-
"webpack": "^4.29.3",
16-
"webpack-cli": "^3.2.3",
17-
"webpack-dev-server": "^3.1.14"
12+
"clean-webpack-plugin": "^4.0.0",
13+
"copy-webpack-plugin": "^11.0.0",
14+
"html-webpack-plugin": "^5.5.0",
15+
"webpack": "^5.74.0",
16+
"webpack-cli": "^4.10.0",
17+
"webpack-dev-server": "^4.11.0"
1818
},
1919
"dependencies": {
20-
"css-loader": "^2.1.0",
20+
"css-loader": "^6.7.1",
2121
"json-loader": "^0.5.7",
22-
"style-loader": "^0.23.1",
23-
"swagger-ui": "^3.20.7",
24-
"yaml-loader": "^0.5.0"
22+
"style-loader": "^3.3.1",
23+
"swagger-ui": "^4.14.0",
24+
"yaml-loader": "^0.8.0"
2525
}
2626
}

docs/samples/webpack-getting-started/webpack.config.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const HtmlWebpackPlugin = require('html-webpack-plugin');
3-
const CleanWebpackPlugin = require('clean-webpack-plugin');
3+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
44
const CopyWebpackPlugin = require('copy-webpack-plugin');
55

66
const outputPath = path.resolve(__dirname, 'dist');
@@ -19,7 +19,7 @@ module.exports = {
1919
test: /\.yaml$/,
2020
use: [
2121
{ loader: 'json-loader' },
22-
{ loader: 'yaml-loader' }
22+
{ loader: 'yaml-loader', options:{ asJSON: true } }
2323
]
2424
},
2525
{
@@ -32,17 +32,15 @@ module.exports = {
3232
]
3333
},
3434
plugins: [
35-
new CleanWebpackPlugin([
36-
outputPath
37-
]),
38-
new CopyWebpackPlugin([
35+
new CleanWebpackPlugin(),
36+
new CopyWebpackPlugin({patterns:[
3937
{
4038
// Copy the Swagger OAuth2 redirect file to the project root;
4139
// that file handles the OAuth2 redirect after authenticating the end-user.
4240
from: require.resolve('swagger-ui/dist/oauth2-redirect.html'),
4341
to: './'
4442
}
45-
]),
43+
]}),
4644
new HtmlWebpackPlugin({
4745
template: 'index.html'
4846
})

0 commit comments

Comments
 (0)