Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Add preact-compat/aliases for consistent use between build tools #425

Closed
ansballard opened this issue Sep 15, 2017 · 5 comments
Closed

Add preact-compat/aliases for consistent use between build tools #425

ansballard opened this issue Sep 15, 2017 · 5 comments

Comments

@ansballard
Copy link

Per #398 (comment)

I was looking into how devtools was split out in the preact repo, and I had a couple questions before diving into a pull request. Currently there's only the single rollup config at the root of the project, but preact has several within a config/ subdirectory. Would you prefer moving to the subdirectory with both the existing and alias config, or keeping both at the root?

Or, the existing rollup config could export an array of configs, since the new aliases.js should be pretty minimal (module.exports = { /* insert 3-line json here */ };). Just wanted to see if you had a preference.

@developit
Copy link
Member

I love this idea. Personally I prefer a single rollup config, but in this case it seems like we could get away with just using ES5 + CommonJS and not even transpiling it?

@ansballard
Copy link
Author

Yep, I figured that would probably be the simplest option. It shouldn't hurt anything to not export an es6 version, and all the other options involve changing the structure of the project in some way. Unless someone else jumps in before me I'll try to get a pull request in tonight after work!

@developit
Copy link
Member

Would love a PR if anyone has time! :)

@ansballard
Copy link
Author

Took a minute to at least figure out what all needs to be included, since I'm lame and never got into this:

  • a straightforward aliases.js file in the root that exports all necessary aliases
  • file should not use es6 exports so it doesn't have to be transpiled (module.exports = { ... })
  • docs/working example using webpack (just import in the webpack config and ... it in the resolve section)
  • docs/working example using browserify (use a separate aliasify config and reference it in package.json like this)
  • docs/working example using babel (babel 7 allows for .babelrc.js, which would allow requiring the same as above, but until that is released maybe a hack with local presets like this?
  • docs/working example using brunch (never used it, seems pretty similar to the others since it's a js config file)

@marvinhagemeister
Copy link
Member

Looks like this has been resolved by using microbundle in our main repo 👍

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

No branches or pull requests

3 participants