javascript - 这些 Webpack v3 ModuleConcatenationPlugin 救助消息是什么意思?

标签 javascript webpack webpack-3

我使用 ModuleConcatenationPlugin 通过 Webpack 3 获得此输出:

  [11] (webpack)/buildin/global.js 509 bytes {0} [built]
       ModuleConcatenation bailout: Module is not an ECMAScript module
  [54] multi ./src/index.js 28 bytes {0} [built]
       ModuleConcatenation bailout: Module is not an ECMAScript module
  [55] ./src/index.js + 33 modules 238 kB {0} [built]
       ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: multi ./src/index.js (referenced with single entry)

webpack自带的文件((webpack)/buildin/global.js)防止拼接?

src/index.js 看起来像这样:

import Calendar from './Calendar'
import DoubleSidedPlane from './DoubleSidedPlane'
import Grid from './Grid'
import Molecule from './Molecule'
import Plane from './Plane'
import PushMenuLayout from './PushMenuLayout'

import * as utils from './utils'
import * as core from './core'
import * as html from './html'
import * as components from './components'

export {
    Calendar,
    DoubleSidedPlane,
    Grid,
    Molecule,
    Plane,
    PushMenuLayout,

    utils,
    core,
    html,
    components,
}

export const version = '17.0.4'

最佳答案

global.js 不会阻止所有模块的串联。该错误意味着这些特定模块未串联。您将需要 ES6 模块来使 ModuleConcatenationPlugin 工作。

关于javascript - 这些 Webpack v3 ModuleConcatenationPlugin 救助消息是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45533577/

相关文章:

webpack - 如何修复带有 "ModuleConcatenation bailout: Module is not an ECMAScript module"救援消息的模块?

javascript - 有没有办法检测用户正在使用什么设备?

webpack - 如何使用 webpack 连接 html 片段?

javascript - 根据值更改 jquery.animate

javascript - 使用 css-modules 时后台 url 中的相对路径不起作用

javascript - 调用 "TypeError: Cannot read property ' 时获取 `npm start` 文件名' of undefined"

javascript - webpack - 输出文件名错误

javascript - 使用 webpack 定义全局变量

javascript - 如何重新绑定(bind)jquery中的事件

javascript - 纯 Javascript 和 HTML 应用程序以及通过 CDN 的部署……好主意?