ts-browser
ts-browser copied to clipboard
How to pass "baseUrl" as compilerOptions when importing?
@klesun I tried doing:
I have local files render/test.ts
:
import "some/file"; // I want to import root/some/file
doStuff();
I do:
<script type="module">
import {loadModule} from 'https://klesun.github.io/ts-browser/src/ts-browser.js';
loadModule('../render/test.ts', {
baseUrl: '../root',
})
</script>
and
<script type="module">
import {loadModule} from 'https://klesun.github.io/ts-browser/src/ts-browser.js';
loadModule('../render/test.ts', {
compilerOptions: {
baseUrl: '../root',
},
});
</script>
but it doesn't load root/render/test.ts
:/ it loads render/test.ts
anyway, as if baseUrl
is ignored. how to do it? I tried using rootDir
, but it also doesn't work.