diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 289b982d94ac..301ac3c5cbc9 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -263,15 +263,13 @@ export const getModule = (appPath: string, { // 让 sass 文件里的 @import 能解析小程序原生样式文体,如 @import "a.wxss"; const extname = path.extname(url) if (extname === '.scss' || extname === '.sass' || extname === '.css') { - done({ - file: url - }) + return null } else { const filePath = path.resolve(path.dirname(prev), url) fs.access(filePath, fs.constants.F_OK, (err) => { if (err) { console.log(err) - done({ file: url }) + return null } else { fs.readFile(filePath) .then(res => { @@ -279,7 +277,7 @@ export const getModule = (appPath: string, { }) .catch(err => { console.log(err) - done({ file: url }) + return null }) } }) diff --git a/packages/taro-webpack-runner/src/util/chain.ts b/packages/taro-webpack-runner/src/util/chain.ts index 5f4397274f25..bee6525d6caa 100644 --- a/packages/taro-webpack-runner/src/util/chain.ts +++ b/packages/taro-webpack-runner/src/util/chain.ts @@ -416,15 +416,13 @@ export const getModule = (appPath: string, { // 让 sass 文件里的 @import 能解析小程序原生样式文体,如 @import "a.wxss"; const extname = path.extname(url) if (extname === '.scss' || extname === '.sass' || extname === '.css') { - done({ - file: url - }) + return null } else { const filePath = path.resolve(path.dirname(prev), url) fs.access(filePath, fs.constants.F_OK, (err) => { if (err) { console.log(err) - done({ file: url }) + return null } else { fs.readFile(filePath) .then(res => { @@ -432,7 +430,7 @@ export const getModule = (appPath: string, { }) .catch(err => { console.log(err) - done({ file: url }) + return null }) } })