Skip to content

Commit

Permalink
Merge pull request #1182 from GitaiQAQ/master
Browse files Browse the repository at this point in the history
fix: 修复在 Windows 下编译阻塞的问题
  • Loading branch information
RubyLouvre committed Oct 24, 2019
2 parents d8e4f80 + 8d3edac commit 7ec91b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli/nanachi-loader/loaders/nodeLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as babel from '@babel/core';
import { NanachiQueue } from './nanachiLoader';

const isReact = function(sourcePath: string){
return /\/source\/React\w+\.js$/.test(sourcePath);
return path.basename(sourcePath).startsWith("React") && path.basename(path.dirname(sourcePath)) === "source";
};

module.exports = async function(code: string, map: any, meta: any) {
Expand Down Expand Up @@ -55,4 +55,4 @@ module.exports = async function(code: string, map: any, meta: any) {
queues,
exportCode: code
}, map, meta);
};
};

0 comments on commit 7ec91b5

Please sign in to comment.