引用其他文件夹下的.js脚本,运行没问题,但构建失败

  • Creator 版本:1.8.2

  • 目标平台: wechat game

  • 详细报错信息,包含调用堆栈:
    Build Failed: Compile error: Cannot require ‘Scene/A.js’ from ‘D:\lzk2018\HlGG\HlggClient\assets\Script’. Module not found.
    at Readable. (C:\CocosCreator\resources\app.asar\editor\page\compile-worker.js:1:1514)
    at emitOne (events.js:96:13)
    at Readable.emit (events.js:191:7)
    at Labeled. (C:\CocosCreator\resources\app.asar\node_modules\read-only-stream\index.js:28:44)
    at emitOne (events.js:96:13)
    at Labeled.emit (events.js:191:7)
    at Labeled. (C:\CocosCreator\resources\app.asar\node_modules\stream-splicer\index.js:130:18)
    at emitOne (events.js:96:13)
    at Labeled.emit (events.js:191:7)
    at Deps. (C:\CocosCreator\resources\app.asar\node_modules\stream-splicer\index.js:130:18)
    at Async.series.t (C:\CocosCreator\resources\app.asar\editor\core\builder.js:1:3024)
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:726:13
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:264:21
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:44:16
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:723:17
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:167:37
    at Gulp.doneCallback (C:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:17460)
    at Gulp.Orchestrator.stop (C:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:150:9)

  • 重现方式:构建发布界面->点构建发布

@jare

直接require(“文件名”) 就好了,但是如果有两个文件名一样的js 咋办?

官方要求好像是不能有2个一样的文件名