Revert "Change target to ES5 for targeting Hermes Engine, disable noEmitHelpers, don't crash if registerOnGlobalContext fails, and disable the special transform for NativeClass decorator"

This reverts commit 7e0497c8b1.
This commit is contained in:
shirakaba
2023-12-02 11:38:29 +09:00
parent 24f5906d1c
commit e04e9b6909
7 changed files with 22 additions and 30 deletions

View File

@@ -274,7 +274,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
},
getCustomTransformers() {
return {
before: [],
before: [require('../transformers/NativeClass').default],
};
},
});

View File

@@ -5,8 +5,6 @@ import ts from 'typescript';
*/
export default function (ctx: ts.TransformationContext) {
function isNativeClassExtension(node: ts.ClassDeclaration) {
return false;
let decorators: Readonly<ts.Decorator[]>;
if ('canHaveDecorators' in ts && ts.canHaveDecorators(node)) {
@@ -37,7 +35,7 @@ export default function (ctx: ts.TransformationContext) {
node.getText().replace(/@NativeClass(\((.|\n)*?\))?/gm, ''),
{
compilerOptions: {
noEmitHelpers: false,
noEmitHelpers: true,
module: ts.ModuleKind.ESNext,
target: ts.ScriptTarget.ES5,
experimentalDecorators: true,

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"target": "es5",
"target": "es2017",
"module": "commonjs",
"outDir": "./dist",
"declaration": true,