mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
test(es/modules): Add tests for jsc.paths
(#5876)
**Description:** Those issues were wrong. **Related issue:** - Closes https://github.com/swc-project/swc/issues/4890 - Closes https://github.com/swc-project/swc/issues/5214
This commit is contained in:
parent
dd2a7c1cd1
commit
0d492bfce1
24
crates/swc/tests/fixture/issues-4xxx/4890/input/.swcrc
Normal file
24
crates/swc/tests/fixture/issues-4xxx/4890/input/.swcrc
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"jsc": {
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"./src/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": "./",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": true,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"transform": {
|
||||
"react": {
|
||||
"runtime": "automatic"
|
||||
}
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
}
|
||||
}
|
4
crates/swc/tests/fixture/issues-4xxx/4890/input/index.js
Normal file
4
crates/swc/tests/fixture/issues-4xxx/4890/input/index.js
Normal file
@ -0,0 +1,4 @@
|
||||
import styles from '~/MyModule.scss'
|
||||
|
||||
|
||||
console.log(styles)
|
@ -0,0 +1,3 @@
|
||||
div{
|
||||
color: red;
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
import styles from "./src/MyModule.scss";
|
||||
console.log(styles);
|
24
crates/swc/tests/fixture/issues-5xxx/5214/1/input/.swcrc
Normal file
24
crates/swc/tests/fixture/issues-5xxx/5214/1/input/.swcrc
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"jsc": {
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"./src/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": "./",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": true,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"transform": {
|
||||
"react": {
|
||||
"runtime": "automatic"
|
||||
}
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
import styles from '~/foo.bar.baz'
|
||||
|
||||
|
||||
console.log(styles)
|
@ -0,0 +1,4 @@
|
||||
import styles from '~/foo.bar.baz.js'
|
||||
|
||||
|
||||
console.log(styles)
|
@ -0,0 +1 @@
|
||||
console.log('exists')
|
@ -0,0 +1,2 @@
|
||||
import styles from "./src/foo.bar.baz";
|
||||
console.log(styles);
|
@ -0,0 +1,2 @@
|
||||
import styles from "./src/foo.bar.baz.js";
|
||||
console.log(styles);
|
@ -0,0 +1 @@
|
||||
console.log("exists");
|
24
crates/swc/tests/fixture/issues-5xxx/5214/2/input/.swcrc
Normal file
24
crates/swc/tests/fixture/issues-5xxx/5214/2/input/.swcrc
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"jsc": {
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"./src/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": "./",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": true,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"transform": {
|
||||
"react": {
|
||||
"runtime": "automatic"
|
||||
}
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
import styles from '~/foo.bar.baz'
|
||||
|
||||
|
||||
console.log(styles)
|
@ -0,0 +1,4 @@
|
||||
import styles from '~/foo.bar.baz.js'
|
||||
|
||||
|
||||
console.log(styles)
|
@ -0,0 +1,2 @@
|
||||
import styles from "./src/foo.bar.baz";
|
||||
console.log(styles);
|
@ -0,0 +1,2 @@
|
||||
import styles from "./src/foo.bar.baz.js";
|
||||
console.log(styles);
|
Loading…
Reference in New Issue
Block a user