Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Commit

Permalink
Fix error about dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitive committed Jun 21, 2017
1 parent 92ad2a4 commit aeba95f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
### Typescript dynamic import
### Typescript dynamic import example

I get error `Dynamic import cannot be used when targeting ECMAScript 2015 modules.`
when I try to use dynamic import inside typescript project with `"module": "es2015"`
in configuration. The error message makes it clear that I can't use `import()` with
es modules but it doesn't make sense because `import()` is part of es modules.

However, it compiles correctly but throw annoing error.

You can check typescript output by running `npm run build-ts`. Compiled files
will be in `build/` folder.
And also you can check that webpack process it correctly by running `npm run build-webpack`
and opening `index.html`
See source code
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es2015.promise"
],
"moduleResolution": "node",
"module": "es2015",
"module": "esnext",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noUnusedLocals": true,
Expand Down

0 comments on commit aeba95f

Please sign in to comment.