Giter Club home page Giter Club logo

Comments (8)

rkostrzewski avatar rkostrzewski commented on May 22, 2024 2

Guys, let's keep it at #15 πŸ˜›

from preact-cli.

developit avatar developit commented on May 22, 2024 1

There isn't yet, but it's something we need to add. I've proposed an optional file preact.config.js:

module.exports = config => {
  // config is the webpack configuration.
  // you can mutate it here before webpack runs.

  let babel = config.loaders.find( ({ loader }) => loader.match(/babel-loader/) );
  // add your plugins:
  babel.options.plugins.push( 'transform-strip-flow-types' );
};

Alternatively, it might be fine to add a --babel-plugins CLI argument that handles this likely common case. Or, better yet, we can have preact-cli look for a .babelrc file in your repo root and use that if it exists πŸŽ‰

from preact-cli.

cedric-marcone avatar cedric-marcone commented on May 22, 2024

Or, is there any config override to provide babel with the right plugins ?

from preact-cli.

cedric-marcone avatar cedric-marcone commented on May 22, 2024

Awesome !
As extending Webpack config is a superset of extending babel config, I would favor your preact.config.js proposal, but using ${PROJECT}/.babelrc could be smooth enough in most cases πŸ‘

from preact-cli.

thangngoc89 avatar thangngoc89 commented on May 22, 2024

Next.js allow to have a custom config file like this. But manipulation the webpack config without any helpers is actually a pain, especially the loaders section.

from preact-cli.

reznord avatar reznord commented on May 22, 2024

There is a flow plugin which we can use for using flow in preact-cli.

Thanks to @SaraVieira πŸ˜„

from preact-cli.

SaraVieira avatar SaraVieira commented on May 22, 2024

@reznord Hells yeah πŸŽ‰

from preact-cli.

eugenesimakin avatar eugenesimakin commented on May 22, 2024

There is a flow plugin which we can use for using flow in preact-cli.

Thanks to @SaraVieira πŸ˜„

Hi guys,
FYI this approach is not working out of box.
For more details see SaraVieira/preact-cli-plugin-flow#7

from preact-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.