feat(webpack, schema): add webpack experiments configuration (#21446)

This commit is contained in:
Wilson Pinto 2023-06-07 21:49:46 +02:00 committed by GitHub
parent 5a25fca475
commit 857511f448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -290,5 +290,11 @@ export default defineUntypedSchema({
* @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>} * @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>}
*/ */
warningIgnoreFilters: [], warningIgnoreFilters: [],
/**
* Configure [webpack experiments](https://webpack.js.org/configuration/experiments/)
* @type {false | typeof import('webpack').Configuration['experiments']}
*/
experiments: {}
} }
}) })

View File

@ -39,7 +39,9 @@ function baseConfig (ctx: WebpackConfigContext) {
...options.webpack.optimization, ...options.webpack.optimization,
minimizer: [] minimizer: []
}, },
experiments: {}, experiments: {
...options.webpack.experiments
},
mode: ctx.isDev ? 'development' : 'production', mode: ctx.isDev ? 'development' : 'production',
cache: getCache(ctx), cache: getCache(ctx),
output: getOutput(ctx), output: getOutput(ctx),