webpack/test/configCases/ecmaVersion/browserslist-query/webpack.config.js

42 lines
989 B
JavaScript
Raw Normal View History

"use strict";
2020-09-24 20:41:54 +08:00
/** @type {import("../../../../").Configuration} */
module.exports = {
2020-09-28 16:53:20 +08:00
target: "browserslist: ie 9",
plugins: [
(compiler) => {
compiler.hooks.compilation.tap("Test", (compilation) => {
2020-09-28 16:53:20 +08:00
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
Object {
"arrowFunction": false,
2024-01-14 22:37:32 +08:00
"asyncFunction": false,
2020-09-28 16:53:20 +08:00
"bigIntLiteral": false,
"const": false,
"destructuring": false,
2024-03-25 21:07:02 +08:00
"document": true,
2020-09-28 16:53:20 +08:00
"dynamicImport": false,
"dynamicImportInWorker": false,
2020-09-28 16:53:20 +08:00
"forOf": false,
2023-05-30 02:27:48 +08:00
"globalThis": false,
2020-09-28 16:53:20 +08:00
"module": false,
2024-04-12 00:24:59 +08:00
"nodePrefixForCoreModules": false,
2023-05-30 02:27:48 +08:00
"optionalChaining": false,
"templateLiteral": false,
2020-09-28 16:53:20 +08:00
}
`);
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
Object {
"electron": false,
"electronMain": false,
"electronPreload": false,
"electronRenderer": false,
"node": false,
"nwjs": false,
"web": true,
}
`);
});
}
]
2020-09-24 20:41:54 +08:00
};