Comments (8)
Guys, let's keep it at #15 π
from preact-cli.
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.
Or, is there any config override to provide babel with the right plugins ?
from preact-cli.
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.
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.
There is a flow plugin which we can use for using flow in preact-cli
.
Thanks to @SaraVieira π
from preact-cli.
@reznord Hells yeah π
from preact-cli.
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)
- compilingβ ERROR Error: Babel-loader config not found!!! HOT 9
- Pages duplicate when accessing with /index.html HOT 9
- Brotli build - outputs content to same filename HOT 4
- default project template doesn't work with Node v18 HOT 4
- ERROR Error: error:0308010C:digital envelope routines::unsupported HOT 1
- Duplicated content when using /routes when using CLI v4 HOT 5
- Homepage content loaded on all non-prerendered pages HOT 3
- Add Typescript increasses the bundle size HOT 4
- Can't resolve 'preact-cli-entrypoint' HOT 4
- Exported rest param syntax functions create invalid build JS HOT 4
- preact-cli hangs after "β Done!" HOT 5
- CSS source maps missing in build output HOT 3
- Typescript v5.1.6 compatibility HOT 2
- Route code-splitting breaks lazy loading of images HOT 3
- Use esbuild instead of babel HOT 2
- Fail to build due to `property missing ':'` when inline style HOT 4
- "TypeError: Cannot read properties of undefined (reading 'call')" when trying to route split HOT 7
- OptimizeCssAssetsPlugin causes build to crash in Yarn PnP mode HOT 2
- Config file failure when adding plugins HOT 8
- build gets stuck at "after chunk asset optimization" HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preact-cli.