huxiaoqi567 / xscroll

A Javascript Scrolling Framework For Mobile Web
http://xscroll.github.io/
457 stars 61 forks source link

在使用Babel编译的时候报在函数外部不能return的语法错误 #29

Open CodeDaraW opened 7 years ago

CodeDaraW commented 7 years ago

报错如下:

Module build failed: SyntaxError: 'return' outside of function (323:1)

  321 | /** ignored by jsdoc **/
  322 | else {
> 323 |     return Util;
      |     ^
  324 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 5:11-28
./~/_xscroll@3.1.3@xscroll/src/animate.js
Module build failed: SyntaxError: 'return' outside of function (346:1)

  344 | /** ignored by jsdoc **/
  345 | else {
> 346 |     return Animate;
      |     ^
  347 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 8:14-34
./~/_xscroll@3.1.3@xscroll/src/base.js
Module build failed: SyntaxError: 'return' outside of function (66:1)

  64 | /** ignored by jsdoc **/
  65 | else {
> 66 |  return Base;
     |  ^
  67 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 6:11-28
./~/_xscroll@3.1.3@xscroll/src/timer.js
Module build failed: SyntaxError: 'return' outside of function (163:1)

  161 | /** ignored by jsdoc **/
  162 | else {
> 163 |     return Timer;
      |     ^
  164 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 7:12-30
./~/_xscroll@3.1.3@xscroll/src/hammer.js
Module build failed: SyntaxError: 'return' outside of function (2453:4)

  2451 | /** ignored by jsdoc **/
  2452 | else {
> 2453 |     return Hammer;
       |     ^
  2454 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 9:13-32
./~/_xscroll@3.1.3@xscroll/src/origin-scroll.js
Module build failed: SyntaxError: 'return' outside of function (134:4)

  132 | /** ignored by jsdoc **/
  133 | else {
> 134 |     return OriginScroll;
      |     ^
  135 | }

 @ ./~/_xscroll@3.1.3@xscroll/src/xscroll.js 11:19-45
./~/_xscroll@3.1.3@xscroll/src/simulate-scroll.js
Module build failed: SyntaxError: 'return' outside of function (696:2)

  694 | /** ignored by jsdoc **/
  695 | else {
> 696 |   return SimuScroll;
      |   ^
  697 | }

是不是可以提供编译后版本呢? package.json里暴露出编译后的单文件。