Skip to content

'import' and 'export' may only appear at the top level  #39

@yqrashawn

Description

@yqrashawn
Module parse failed: /path/to/project/node_modules/imports-loader/index.js?this=>window!/path/to/project/src/entry.js 'import' and 'export' may only appear at the top level (4:0)
You may need an appropriate loader to handle this file type.
| (function() {
|
| import './NameSpace';
| import './Polyfill';
    rules: [
      {
        test: regx,
        use: [
          {
            loader: "imports-loader?this=>window",
          },
        ],
      },
    ],

But import 'imports-loader?this=>window./NameSpace'; this works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions