preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
949 stars 148 forks source link

Docs for new users: how to use with preact-cli #466

Closed dandv closed 6 years ago

dandv commented 6 years ago

I'm new to Preact and can't figure out how to add preact-compat to an app I've just created with preact create material myapp. Do I go the Babel route? Webpack? There are no config files in the newly created app that I can edit and the example is almost 3 years old.

kevlened commented 6 years ago

@dandv Fortunately, preact-cli configures preact-compat for you! The cli uses webpack under the hood and the base configurations can be found here. Here's where react is aliased to preact-compat.

To configure webpack for any other reason, add preact.config.js to your project's root directory. More details here.

developit commented 6 years ago

Thanks @kevlened!