Skip to content

dynamic await import not supported #40

Open
@uptonking

Description

@uptonking

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

// 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' }))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions