Hello,
This monday morning, I'm toying with preact-cli : super enjoyable experience !
I was just wondering what's your stance on Flow type system support ?
Thanks :)
Or, is there any config override to provide babel with the right plugins ?
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 馃帀
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 馃憤
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.
Guys, let's keep it at #15 馃槢
There is a flow plugin which we can use for using flow in preact-cli.
Thanks to @SaraVieira 馃槃
@reznord Hells yeah 馃帀
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 https://github.com/SaraVieira/preact-cli-plugin-flow/issues/7
Most helpful comment
Guys, let's keep it at #15 馃槢