Skip to content
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

Allow to customise built-in babel config #44

Closed
iSokrat opened this issue Feb 3, 2023 · 12 comments · Fixed by #45
Closed

Allow to customise built-in babel config #44

iSokrat opened this issue Feb 3, 2023 · 12 comments · Fixed by #45

Comments

@iSokrat
Copy link

iSokrat commented Feb 3, 2023

Based on this discussion: #13 (comment)

We need to have ability to somehow overwrite built-in configuration for babel. Without this we can't apply postcss-lit for the files, where, for example, different approach for decorators in js is used.

@iSokrat
Copy link
Author

iSokrat commented Feb 7, 2023

@43081j Could you please take a look?

@43081j
Copy link
Owner

43081j commented Feb 8, 2023

so sorry i've taken a while to get to this @iSokrat

its been a busy couple of weeks.

off the top of my head, there isn't anywhere in postcss config to pass plugin settings. so it may end up i need to contribute back upstream to postcss, or we put the config elsewhere (e.g. package.json).

ill have a look at it this week for sure

@43081j
Copy link
Owner

43081j commented Feb 12, 2023

just to update, this is more difficult than expected.

basically i was wondering if we can just auto-detect a babelrc and load that. but the babel module which does that produces a different structure than what the babel parser needs.

it may be we just have an extra section in the postcss config or package.json.

@iSokrat
Copy link
Author

iSokrat commented Feb 14, 2023

@43081j How do you see this may look via postcss config? Do you already have some POC?

@43081j
Copy link
Owner

43081j commented Feb 14, 2023

i think whichever file we put it in, we'll need logic (e.g. through cosmiconfig or postcss-load-config) to pull the relevant config file in. then look in there for some custom property like lit: {babelOptions: {...}}.

we don't already get access to the config so its likely upto us to read it in like that

@iSokrat
Copy link
Author

iSokrat commented Feb 16, 2023

Okay, let's then review the total result, thanks.

@iSokrat
Copy link
Author

iSokrat commented Feb 21, 2023

@43081j Hello, any updates regarding this issue?

@43081j
Copy link
Owner

43081j commented Feb 21, 2023

there you go, i have implemented it in #45

sorry it took so long, i have had a lot to work on this month.

@iSokrat
Copy link
Author

iSokrat commented Feb 22, 2023

No worries, everything is fine

@43081j
Copy link
Owner

43081j commented Feb 22, 2023

ill see if i can get it merged and released this weekend 👍

thanks a lot for the suggestion too

@iSokrat
Copy link
Author

iSokrat commented Mar 1, 2023

Hello @43081j . I think this change is not available on NPM. Will you publish this change there?

@43081j
Copy link
Owner

43081j commented Mar 1, 2023

@iSokrat published 1.1.0

let me know if it works for you 👍

you can find an example in the bottom of the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants