-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
rootDir option not passed #226
Conversation
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
==========================================
+ Coverage 74.82% 75.05% +0.23%
==========================================
Files 11 11
Lines 417 421 +4
Branches 156 160 +4
==========================================
+ Hits 312 316 +4
Misses 100 100
Partials 5 5
Continue to review full report at Codecov.
|
tasks.push({ | ||
title: `Bundle ${source.files.join(', ')} in ${format} format`, |
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.
Oops, I've mixed this here.
This would be more related to when you want multiple build targets though. #219
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.
<question>Any plans for supporting loading proper {targets:{}}
hash-map depending on the target?</question>
src/index.ts
Outdated
@@ -75,12 +75,14 @@ export class Bundler { | |||
constructor(config: Config, public options: Options = {}) { | |||
logger.setOptions({ logLevel: options.logLevel }) | |||
|
|||
this.rootDir = path.resolve(options.rootDir || '.') | |||
const rootDir = options.rootDir || '.' | |||
this.rootDir = path.resolve(rootDir) |
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.
I guess we don't need to change these lines
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.
We don't indeed.
<question>
Could we have a way to support splitting configuration from there for monorepo setup?
Let's say we have settings common for all in './bili.config.js'.
When we're asking to run bili from another rootDir, we could merge the two bili.config.js (with other possible file names)
From there, we could have a way to check if the value is '.' and we want a way to use bili.config.js from there, then, resolve from ./${rootDir}/bili.config.js and merge values from there.
What do you think?
</question>
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.
I prefer the way tsconfig.json
works:
- You can populate a common
bili.config.js
in root directory, and anotherbili.config.js
withmodule.exports = {extends:'../../bili.config.js'}
in a leaf package likepackages/foo
- Then you can run
bili
inpackages/foo
(not implemented yet)
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.
Which part is not implemented yet.
The "extends" key part that'd take the string, resolve its path and (?).
If you want a reproduction repo with modules in different formats, along with testing you can use the "reproduction repo" in #219 (I can add more use-cases too: tsx,jsx,vue,ts,js,wasm,yaml, -- things rollup plugins can handle-- etc).
@@ -58,6 +58,7 @@ cli | |||
.example(bin => ` ${bin} --input.index src/foo.ts`) | |||
.action(async (input, options) => { | |||
const { Bundler } = await import('./') | |||
const rootDir = options.rootDir || '.' |
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.
So, this PR would only be for this line then.
1bfeb64
to
02a622c
Compare
* Added DEBUG to make @babel/preset-env debug
02a622c
to
475938e
Compare
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
==========================================
+ Coverage 74.82% 75.05% +0.23%
==========================================
Files 11 11
Lines 417 421 +4
Branches 156 160 +4
==========================================
+ Hits 312 316 +4
Misses 100 100
Partials 5 5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
========================================
+ Coverage 74.82% 75% +0.17%
========================================
Files 11 11
Lines 417 420 +3
Branches 156 158 +2
========================================
+ Hits 312 315 +3
Misses 100 100
Partials 5 5
Continue to review full report at Codecov.
|
🎉 This PR is included in version 4.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Related to #225