2025-10-02 01:12:27 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/** @type {import("../../../../").Configuration} */
|
|
|
|
module.exports = {
|
|
|
|
target: "browserslist:maintained node versions",
|
|
|
|
plugins: [
|
|
|
|
(compiler) => {
|
|
|
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
|
|
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
|
|
|
Object {
|
|
|
|
"arrowFunction": true,
|
|
|
|
"asyncFunction": true,
|
|
|
|
"bigIntLiteral": true,
|
|
|
|
"const": true,
|
|
|
|
"destructuring": true,
|
|
|
|
"document": false,
|
|
|
|
"dynamicImport": true,
|
2025-10-03 00:19:35 +08:00
|
|
|
"dynamicImportInWorker": true,
|
2025-10-02 01:12:27 +08:00
|
|
|
"forOf": true,
|
|
|
|
"globalThis": true,
|
|
|
|
"module": true,
|
|
|
|
"nodePrefixForCoreModules": true,
|
|
|
|
"optionalChaining": true,
|
|
|
|
"templateLiteral": true,
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
|
|
|
Object {
|
|
|
|
"electron": false,
|
|
|
|
"electronMain": false,
|
|
|
|
"electronPreload": false,
|
|
|
|
"electronRenderer": false,
|
|
|
|
"node": true,
|
|
|
|
"nwjs": false,
|
|
|
|
"web": false,
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|