-
Notifications
You must be signed in to change notification settings - Fork 400
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
feat: expose cwd
in input options
#692
feat: expose cwd
in input options
#692
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
@hyf0 I refactored rolldown tests to use |
@@ -4,7 +4,8 @@ import { expect } from 'vitest' | |||
import { getOutputChunkNames } from '@tests/utils' | |||
|
|||
const config: RollupOptions = { | |||
input: [path.join(__dirname, 'main.js'), path.join(__dirname, 'entry.js')], | |||
input: ['main.js', 'entry.js'], | |||
cwd: __dirname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you already pass cwd
in packages/rolldown/tests/fixture.test.ts
, this is unnessary to pass it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also remove this line
dir: outputOptions.dir ?? nodePath.join(fixturePath, 'dist'), |
Rolldown will emit to <CWD>/dist
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Exposes `cwd` prop in `InputOptions` and updates rolldown tests to leverage it. Closes rolldown#687
3a36c55
to
0dffe3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hyf0 I was able to remove a lot of path manipulation from this file and tests are passing just fine. Let me know if you think we should keep the old code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
Exposes
cwd
prop inInputOptions
and updates rolldown tests toleverage it. Closes #687