Skip to content

Commit c4509e5

Browse files
authored
fix(pack): alias donesn't work for style file (#2539)
* fix(pack): alias donesn't work for style file * fix(pack): alias donesn't work for style file
1 parent abae32c commit c4509e5

11 files changed

Lines changed: 166 additions & 117 deletions

File tree

crates/pack-tests/tests/snapshot/basic/alias/config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
"resolve": {
1010
"alias": {
1111
"hello-a": "./input/a.ts",
12-
"@@/": "./input/"
12+
"@@/": "./input/",
13+
"@/*": "./input/*"
1314
}
1415
},
1516
"optimization": {
16-
"minify": false
17+
"minify": false,
18+
"moduleIds": "named"
1719
}
1820
}
1921
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.nav {
2+
background-color: red;
3+
}

crates/pack-tests/tests/snapshot/basic/alias/input/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { aliasPkg, aliasA } from "alias-pkg";
33
import { bar } from '@@/a';
44
import { aliasB } from '@@/b';
55
import { a as browserslistA } from 'browserslist';
6+
import style from '@/index.less';
7+
import { a } from '@/a?query';
8+
9+
console.log('a', a);
10+
11+
console.log('style', style);
612

713
console.log(browserslistA, foo, aliasPkg, bar);
814

crates/pack-tests/tests/snapshot/basic/alias/output/_project___662e3067.js

Lines changed: 126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pack-tests/tests/snapshot/basic/alias/output/_project___662e3067.js.map

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pack-tests/tests/snapshot/basic/alias/output/_project___e1c221d7.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

crates/pack-tests/tests/snapshot/basic/alias/output/_project___e1c221d7.js.map

Lines changed: 0 additions & 11 deletions
This file was deleted.

crates/pack-tests/tests/snapshot/basic/alias/output/input_index_less_149e42e4.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pack-tests/tests/snapshot/basic/alias/output/input_index_less_149e42e4.css.map

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
22
typeof document === "object" ? document.currentScript : undefined,
3-
{"otherChunks":["_project___e1c221d7.js"],"runtimeModuleIds":[734]}
3+
{"otherChunks":["_project___662e3067.js","input_index_less_149e42e4.css"],"runtimeModuleIds":["[project]/basic/alias/input/index.ts [client] (ecmascript)"]}
44
]);
55
// Dummy runtime

0 commit comments

Comments
 (0)