5

我使用 Webpack 3 得到这个输出,使用ModuleConcatenationPlugin

  [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'
4

1 回答 1

0

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

于 2017-10-31T16:30:26.683 回答