import missing scss file hang wepy build

tpxzln5u  于 2021-11-29  发布在  Java
关注(0)|答案(0)|浏览(207)

Description

@import import missing scss file hang wepy build.

Environment

  • Platform: macOS 10.15, nodejs 10.16.3
  • wepy-cli version: 2.0.0-alpha.20
  • wepy version: 2.0.0-alpha.9
  • @wepy/compiler-sass: 2.0.1

Reproduce

Import a missing scss file as the relevant code below and build with wepy

Observed Results

wepy hang

Expected Results

Report the missing file and fail this build.

Relevant Code / Logs

// app.wpy
<style lang="scss">
@import './file-not-exist.scss';
</style>
// ...

FYI

wepy/packages/compiler-sass/resolveImporter.js

Lines 15 to 21 in 593cc7c

| | returnfunction(url,prev,done){ |
| | letdir=path.dirname(prev==='stdin' ? file : prev); |
| | |
| | doResolve(dir,importsToResolve(url)) |
| | .then(done) |
| | .catch(()=>({file: url})); |
| | }; |

wepy hang after catch return. As this is the last importer would it be ok to return the error? That could solve the problem.

Quote from node-sass. Out of curiosity why not return null as an error occur this importer could not contribute any effort to the resolving process? And return null also hang wepy build.

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题