Skip to content

Commit

Permalink
test: ✅ add a require + context module test case
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Jun 3, 2024
1 parent 22e1c75 commit 0107ac8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.red{
color:red;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function loadByRequire(f: string): any {
return require(`./${f}`);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions packages/preset-umi/fixtures/prepare-build/normal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import './a.ext-must-not-exist';
import './a.html';
// relative imports
import { bar } from './bar/bar';
import { load } from './context/context';
import { loadByRequire } from './context2/';
import { foo } from './foo';
import { load } from './context/context'

console.log(foo);
console.log(bar);
console.log(load)
console.log(load);
console.log(loadByRequire);

0 comments on commit 0107ac8

Please sign in to comment.