Merge pull request #17634 from Snuffleupagus/rm-preprocessor-require

Remove support for `require` statements from the build system
This commit is contained in:
Jonas Jenwald 2024-02-08 16:22:17 +01:00 committed by GitHub
commit 0d5183a49f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 15 deletions

View File

@ -170,17 +170,6 @@ function babelPluginPDFJSPreprocessor(babel, ctx) {
);
path.replaceWith(t.inherits(t.valueToNode(result), path.node));
}
// require('string')
if (
t.isIdentifier(node.callee, { name: "require" }) &&
node.arguments.length === 1 &&
t.isStringLiteral(node.arguments[0]) &&
ctx.map?.[node.arguments[0].value]
) {
const requireName = node.arguments[0];
requireName.value = requireName.raw = ctx.map[requireName.value];
}
},
BlockStatement: {
// Visit node in post-order so that recursive flattening

View File

@ -1,5 +1,3 @@
import { Test } from "import-name";
import { Test2 } from './non-alias';
export { Test3 } from "import-name";
var Imp = require("import-name");
var Imp2 = require('./non-alias');

View File

@ -1,5 +1,3 @@
import { Test } from 'import-alias';
import { Test2 } from './non-alias';
export { Test3 } from 'import-alias';
var Imp = require('import-alias');
var Imp2 = require('./non-alias');