Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Last active October 11, 2017 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaraVieira/ab76cd4258a1e77c75829c6b38aa2ab1 to your computer and use it in GitHub Desktop.
Save SaraVieira/ab76cd4258a1e77c75829c6b38aa2ab1 to your computer and use it in GitHub Desktop.

Why is command x is in the Readme but it doesn't work ?

The Readme in Github points to master in preact-cli and that is the development branch so it's possible that some commands may still not be available in the last version but as soon as there is a bump in the version they will available. You can always rely on the Readme in NPM.

How do I modify SW config ?

We have a plugin for that preact-cli-sw-precache and this allows you customize SW as you please.

How do I change the template to add Google Analytics/Google Fonts ?

You can change the template being used to render your webiste with the -template flag. This is the default one and you can add your missing scripts here.

And change your package.json from:

preact build
to
preact build --template my-template.html

And

preact watch
to
preact watch --template my-template.html

Can I use other postcss plugins apart from autoprefixer ?

Sure you can man ! You can either edit the preact.config.js like in here or install the plugin that will read from your postcss.config.js

How can I use Flow/Typescript ?

As you may have guessed we have plugins for that this is the one for Flow and this is the one for typescript.

Any official way of handling tests in preact-cli ?

So far no , we are discussing that right here so you can join in the discussion.

Why no Redux/Mobx integration ?

Well in our idea this is more of a personal decision. First of all we know that not all websites will need a state manager and secondly building for one will cause more issues for the people using the other one so we made this stay in user land so you can you do as you please

Is there an eject option ?

At the moment no because we feel like we have the needed flexibility but if you believe there sgould be one please speak up in this issue.

You mention the preact.config.js but how do I change it ?

Well we have a Config Recipes that you can look for some inspiration and if you need more help feel free to reach out.

I'm stuck how can I talk to you guys ?

The preact team is on Slack and you can get an invite here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment