共被编辑 1 次

版本 更新时间 贡献者 编辑原因 操作
#r1 2018年02月27日 LossingDawn40 创建问题 查看

weex对es6语法报错,...

根据官网,进行weex的初始化安装,最后启动的时候,报错

H:\workspace\webstorm\weex-t>npm start

> weex-t@1.0.0 start H:\workspace\webstorm\weex-t
> npm run serve


> weex-t@1.0.0 serve H:\workspace\webstorm\weex-t
> webpack-dev-server --env.NODE_ENV=development --progress

H:\workspace\webstorm\weex-t\configs\webpack.common.conf.js:95
    ...webEntry,
    ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (H:\workspace\webstorm\weex-t\configs\webpack.dev.conf.js:1:84)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weex-t@1.0.0 serve: `webpack-dev-server --env.NODE_ENV=development --progress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weex-t@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\thinklight\AppData\Roaming\npm-cache\_logs\2018-02-27T08_33_16_191Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weex-t@1.0.0 start: `npm run serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weex-t@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\thinklight\AppData\Roaming\npm-cache\_logs\2018-02-27T08_33_16_239Z-debug.log

是对webpack.common.conf.js中的...报语法错误,这个是官方默认的初始化代码,要怎么解决呢

const webConfig = {
  entry: {
    ...webEntry,
    'vendor': [path.resolve('node_modules/phantom-limb/index.js')]
  },
  output: {
    path: helper.rootNode('./dist'),
    filename: '[name].web.js'
  },
  // 省略若干
}