RodrigoTomeES / astro-rename

Astro-Rename is an Astro integration that brings postcss-rename functionality to your Astro project without the need for configuration.
https://www.npmjs.com/package/astro-rename
GNU General Public License v3.0
15 stars 4 forks source link

feat(ssr): poc #17

Closed gabrielperales closed 1 week ago

gabrielperales commented 3 weeks ago

I'm not sure if this is the right approach, actually, I think the code should be in the astro:build:done hook, but this code is working for me, so maybe we can use it as a starting point for SSR.

Sorry about changing from yarn to npm, but I was struggling with something related to the package manager and I decided to switch it to NPM. I imagine we can delete those changes from the MR.

RodrigoTomeES commented 3 weeks ago

Ey @gabrielperales thanks for your mr I hope to check it tomorrow!

I have one question, you added babel to be able to transform the classes in the JS server files, it isn't?

RodrigoTomeES commented 2 weeks ago

@gabrielperales which errors did you have with yarn? I could install it and the build works

image

gabrielperales commented 2 weeks ago

Ey @gabrielperales thanks for your mr I hope to check it tomorrow!

I have one question, you added babel to be able to transform the classes in the JS server files, it isn't?

Exactly. If was just using the regex over the .mjs it could also replace other stuff. In my case, I found it was replacing a variable called block

gabrielperales commented 2 weeks ago

@gabrielperales which errors did you have with yarn? I could install it and the build works

I don't remember. Nothing important, but I didn't want to deal with that I tried to make it work as fast as I can 😅

RodrigoTomeES commented 2 weeks ago

Ey @gabrielperales thanks for your mr I hope to check it tomorrow! I have one question, you added babel to be able to transform the classes in the JS server files, it isn't?

Exactly. If was just using the regex over the .mjs it could also replace other stuff. In my case, I found it was replacing a variable called block

Yeah, I had a similar issue in one of my projects. In my html the package remove the flex word and replace with the minified class. Could you add a test for your use case? Or give me an example to make it

RodrigoTomeES commented 1 week ago

@all-contributors please add @gabrielperales for code

allcontributors[bot] commented 1 week ago

@RodrigoTomeES

I've put up a pull request to add @gabrielperales! :tada: