mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
ff47e2539e
swc_common: - Fix handling of input source map. (#1930) swc: - Respect `paths`. (#1858) node: - Fix typings of `paths`.
27 lines
524 B
JavaScript
27 lines
524 B
JavaScript
import swc from "../..";
|
|
|
|
it("should respect paths", async () => {
|
|
const { code } = await swc.transform(`
|
|
import foo from '@src/app';
|
|
console.log(foo)
|
|
`, {
|
|
jsc: {
|
|
parser: {
|
|
syntax: 'typescript',
|
|
},
|
|
target: 'es2021',
|
|
transform: {
|
|
|
|
},
|
|
paths: {
|
|
'@src/*': ['bar/*']
|
|
}
|
|
},
|
|
module: {
|
|
type: 'commonjs'
|
|
},
|
|
});
|
|
|
|
expect(code).toContain(`bar/app`);
|
|
})
|