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

[dev-tools] Support babel/webpack config files in package #113

Merged
merged 2 commits into from Mar 7, 2019

Conversation

Projects
None yet
2 participants
@Pessimistress
Copy link
Contributor

commented Mar 7, 2019

  • babel uses .babelrc/babel.config.js in package root before falling back to default config
  • webpack uses webpack.config.js in package root before falling back to default config
  • remove babel config override from ocular-dev-tools.config.js
  • Test script delegate the handling of unknown modes to user config files

I will add documentation in a follow up PR.

@Pessimistress Pessimistress requested a review from ibgreen Mar 7, 2019

@ibgreen

ibgreen approved these changes Mar 7, 2019

Copy link
Contributor

left a comment

Thanks, this is very appreciated, big improvement, good to land!!!

As to my remaining concern: If I read this correctly, this system will work without any config files in the repo, and then even when you add them, it is ocular instead of the application that controls the merging and override management.

So not as easy to discover which files are available for config, and not as easy to "sniff" what settings ocular is using.

In my original thinking you'd be required to have local files, and you would simply import and re-export ocular configs in them.

babel.config.js:

const config = module.require('ocular-dev-tools/babel.config.js');
// check what ocular is doing
// console.log(config)

// Make overrides
config.... = ...;

// Re-export
module.exports = config

FWIW, ocular-gatsby uses this re-export approach for all the gatsby entry point files, and has an init script that copies in the minimal files and sets up all the basic forwarding, allowing the user to directly see how things work and start modifying as appropriate.

So far this explicit setup has seemed to be appreciated by folks we presented the system to, as one of the first questions are concerned about how easy it is to make their own configurations/overrides.

Show resolved Hide resolved modules/dev-tools/scripts/print-config.sh Outdated
Show resolved Hide resolved modules/dev-tools/config/ocular.config.js Outdated
@Pessimistress

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2019

If I read this correctly, this system will work without any config files in the repo, and then even when you add them, it is ocular instead of the application that controls the merging and override management.

If a config file is found in the repo, it is used instead of the default config. There is no merging unless the user imports and uses the default config in their own config file.

@Pessimistress Pessimistress force-pushed the test-extensions branch from 0070082 to 8612510 Mar 7, 2019

@Pessimistress Pessimistress merged commit 9760a7c into master Mar 7, 2019

1 check passed

license/cla Contributor License Agreement is signed.
Details

@Pessimistress Pessimistress deleted the test-extensions branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.