Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修复 windows 下跨平台开发会引入错误平台代码的问题
Browse files Browse the repository at this point in the history
fix #206
  • Loading branch information
Darmody authored and yesmeck committed Oct 9, 2019
1 parent cc5cd34 commit 5f49e57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/remax-cli/src/build/plugins/stub.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import MagicString from 'magic-string';
import { Plugin } from 'rollup';
import winPath from '../../winPath';

interface Options {
modules?: string[];
Expand All @@ -12,7 +13,11 @@ export default function stub(options: Options = {}): Plugin {

transform(code: string, id: string) {
if (options.modules) {
if (options.modules.every(module => id.indexOf(module) === -1)) {
if (
options.modules.every(
module => winPath(id).indexOf(winPath(module)) === -1
)
) {
return null;
}
}
Expand Down

0 comments on commit 5f49e57

Please sign in to comment.