Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass "baseUrl" as compilerOptions when importing? #28

Open
danon opened this issue Jan 31, 2024 · 0 comments
Open

How to pass "baseUrl" as compilerOptions when importing? #28

danon opened this issue Jan 31, 2024 · 0 comments

Comments

@danon
Copy link

danon commented Jan 31, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant