egoist / egoist/import-http

dynamic `await import` not supported

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
30
PR merge metrics
No merged PRs in 30d

Description

@egoist @c4software
after i changed `example/index.js` to the following, `npx webpack` run failed.

``` js
// import template from 'https://unpkg.com/lodash-es/template'

async function testLogAsyncImport() {
const {
default: template
} = await import('https://unpkg.com/lodash-es/template')

console.log(template(`Hello <%= name %>`)({ name: 'EGOIST' }))
}

testLogAsyncImport()
```

the error message

```
ERROR in ./index.js 6:12
Module parse failed: Unexpected token (6:12)
You may need an appropriate loader to handle this file type.
| const {
| default: template
> } = await import('https://unpkg.com/lodash-es/template')
|
| console.log(template(`Hello <%= name %>`)({ name: 'EGOIST' }))

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.