-
Notifications
You must be signed in to change notification settings - Fork 502
tsconfig target option is ignored -- use browserslist for Babel instead #951
Copy link
Copy link
Closed
Labels
kind: questionThis is a usage or similar questionThis is a usage or similar questionkind: supportAsking for support with something or a specific use caseAsking for support with something or a specific use caseproblem: no reproNo reproduction was provided (and have not tried to repro without one)No reproduction was provided (and have not tried to repro without one)problem: staleIssue has not been responded to in some timeIssue has not been responded to in some timesolution: intended behaviorThis is not a bug and is expected behaviorThis is not a bug and is expected behavior
Metadata
Metadata
Assignees
Labels
kind: questionThis is a usage or similar questionThis is a usage or similar questionkind: supportAsking for support with something or a specific use caseAsking for support with something or a specific use caseproblem: no reproNo reproduction was provided (and have not tried to repro without one)No reproduction was provided (and have not tried to repro without one)problem: staleIssue has not been responded to in some timeIssue has not been responded to in some timesolution: intended behaviorThis is not a bug and is expected behaviorThis is not a bug and is expected behavior
Current Behavior
Modern code is not getting transpiled to the
targetspecified intsconfig.json.Expected behavior
It should respect the
targetoption and transpile to that.Suggested solution(s)
I dunno, if
targetis undiserable or whatever, maybe respectbrowserslistinpackage.json? Because that it also doesn't do. Otherwise it should just pick uptargetintsconfig.json. Or I guess it should pick up something, anything, in order to make transpilation happen to a target of my choosing.Additional context
Currently it does only very moderate transpilation, for instance
a ?? bis transpiled, but{ ...a, ...b }is not. Even settingtargetto a ridiculouses3doesn't transpile any more (or less) than setting it toesnext. There should be some difference between the two, wouldn't you say?So it is transpiling to some kind of target, but which one?... I don't know, but not my target, that's for sure.
Your environment
Why are these scripts never seeing my Firefox browser? 🤨
Anyway, maybe it also helps to see my
tsconfig.json:{ "include": ["src", "types"], "compilerOptions": { "target": "es5", "module": "esnext", "lib": ["dom", "esnext", "es2017"], "importHelpers": true, "declaration": true, "downlevelIteration": true, "sourceMap": true, "rootDir": "./", "strict": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "noImplicitThis": true, "alwaysStrict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "baseUrl": "./", "paths": { "*": ["src/*", "node_modules/*"] }, "jsx": "react", "esModuleInterop": true } }To the question "why do you need this?" I can answer simply: because I need to test stuff in this library on old browsers. Maybe libraries should not be transpiled. Maybe they should be. But that is an opinion not quite relevant to this issue. Just wanted to get that off the tables.