-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Esbuild support for CSS property? #348
Comments
I think a possible alternative could be to provide a custom jsx pragma like Emotion does. |
@kitten may I know why this was moved to the Babel plugin repository? My issue is about esbuild, not Babel. If a solution is going to be found, it will not involve Babel. |
Did anyone fund a solution to support the |
For now // build.mjs
import * as esbuild from 'esbuild';
import esbuildPluginBabel from 'esbuild-plugin-babel'; // small utility plugin making a bit easier to run babel transformation
//…
await esbuild.build({
logLevel: 'info',
outdir: './build',
entryPoints: ['./src/index.tsx'],
entryNames: 'static/[name]-[hash]',
metafile: true,
bundle: true,
minify: true,
sourcemap: true,
platform: 'browser',
target: 'chrome117',
tsconfig: './tsconfig-src.json',
define: {
global: 'globalThis',
},
plugins: [
// run as the first plugin
esbuildPluginBabel({
filter: /\.(jsx|tsx)$/u, // only process .jsx and .tsx files
config: {
plugins: [['babel-plugin-styled-components', { pure: true }]],
},
}),
//… other plugins you have
],
}); cc @probablyup as the major contributor to the https://github.com/styled-components/babel-plugin-styled-components repo maybe you would know if |
I really have no time for that unfortunately. Maybe when one of the AI tools gets good enough we can generate one unless someone wants to take a stab at it |
The tricky thing with esbuild is it just gives you raw content and you have to provide your own AST parser. So you end up with something babel-like anyway. |
Hi, I was wondering if there is any plan to add support for an alternative to the Babel Plugin Macro in order to be able to use the CSS property with Esbuild?
The text was updated successfully, but these errors were encountered: