feat(typescript): root relative asset resolution
Rollup Plugin Name: @rollup/plugin-typescript
This PR contains:
- [ ] bugfix
- [x] feature
- [ ] refactor
- [ ] documentation
- [ ] other
Are tests included?
- [x] yes (bugfixes and features will not be merged without tests)
- [ ] no
Breaking Changes?
- [x] yes (breaking changes will not be merged unless absolutely necessary)
- [ ] no
Relevant issues: #1137
Description
This pull request features root relative assets outputting, i.e. declarations and source maps can be places outside of the output directory.
An example where this is needed, and currently not supported, is a setup like this:
dist/
index.js
src/
index.ts
types/
index.d.ts
Currently, the assets (i.e. declarations and source maps) output directory is resolved relative to output.dir or alternatively the path to tsconfig. What this pull request changes is the way which assets is resolved. All assets will be emitted using the already existing emitFile function (not in context). Which tries to resolve relatively, and if unable, will emit using the filesystem.
Optimally, to prevent breaking changes, I suggest the option emitAssetsSeparately to be implemented which can be enabled in needed. This allows the users to specify if they want to be able to place the assets (i.e. declarations and source maps) outside the output directory.
@tscpp checking in on this one. please update from upstream/master and resolve any CI failures.
Closing as abandoned.
I completly forgot about this pr...
I don't need this myself anymore, but is this feature wanted? I could take the time to implement this if appreceated
No worries. Feel free to leave the branch in place, and if anyone comes asking for it we'll resurrect this PR.