Don't wrap import() expression
See original GitHub issueSource:
export function moduleLoadCallback() {
return import(/* webpackChunkName: "a" */ "./a.module")
.then(function (module) { return module.A; });
}
TS Out:
export function moduleLoadCallback() {
return import(/* webpackChunkName: "a" */ "./a.module")
.then(function (module) { return module.A; });
}
TsickleOut:
export function moduleLoadCallback() {
return (import)(/* webpackChunkName: "a" */ "./a.module")
.then(function (module) { return module.A; });
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
wrapper function with es6 import without needing a variable ...
Thanks, but I don't want to wrap the exported object because I may want to pass some options to the wrapper that will...
Read more >Dynamic imports - The Modern JavaScript Tutorial
The import() expression. The import(module) expression loads the module and returns a promise that resolves into a module object that ...
Read more >Add flag to not transpile dynamic `import()` when module is ...
Since Node 12, it is possible to use dynamic imports. Yet I'm not able to tell the TS compiler to not transpile this...
Read more >ES2020: `import()` – dynamically importing ES modules - 2ality
The ECMAScript proposal “ import() ” by Domenic Denicola is at stage 4 and part of ECMAScript 2020. It enables dynamic loading of...
Read more >Python import: Advanced Techniques and Tips
The Python import system is as powerful as it is useful. In this in-depth tutorial, you'll learn how to harness this power to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
angular 5 no longer produces generated .ts code, it is all compiled in one pass. this is because we now use a better architecture with TypeScript transformers. There is no option to go back to .ts codegen.
It sounds like using
annotationsAs: "decorators"
might be a workaround for you?I agree that tsickle processing shouldn’t wrap the import keyword in parens.
Angular use now import() for lazy load so this seems fixed now