docs(samples-webpack): updated config and dependencies (#8184)

This commit is contained in:
An Tran
2022-09-21 19:06:52 -04:00
committed by GitHub
parent 6c03465257
commit 82e3290de4
2 changed files with 15 additions and 17 deletions

View File

@@ -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'
})