Coder Social home page Coder Social logo

Comments (14)

jangerhofer avatar jangerhofer commented on September 28, 2024 1

@developit: Do I understand correctly that the module-alias redirects react and react-dom includes to the corresponding preact packages, as described in the preact-compat config?

I'm wondering because I'd like to use preact (and the convenience of the CLI!) with React packages, but preact-compat requires access to the webpack.config.

from preact-cli.

developit avatar developit commented on September 28, 2024

Ah weird, module-alias was actually never set up. We need to add it to prerender.js. That might actually be the root of some of the other issues.

from preact-cli.

kurtextrem avatar kurtextrem commented on September 28, 2024

couldn't a webpack build be used for the prerender? That way webpack's alias could be used and code functionality wouldn't somewhat get duplicated.

from preact-cli.

developit avatar developit commented on September 28, 2024

Yes. Looks like @rkostrzewski is working on it because he's a genius.

from preact-cli.

kurtextrem avatar kurtextrem commented on September 28, 2024

Awesome! LMK if you need / want help.

(and just for the overview - maybe add the SSR label to this issue and to the PR?)

from preact-cli.

developit avatar developit commented on September 28, 2024

Label added :)

@jangerhofer yes, that's what module-alias would be doing for us. Webpack is already doing it for our browser build, but we are currently doing server rendering straight in Node. Once we move the SSR to using Webpack, the aliases will be handled the same as they are in the browser.

from preact-cli.

asci avatar asci commented on September 28, 2024

is there any workaround? --prerender false is not helping :(

from preact-cli.

rkostrzewski avatar rkostrzewski commented on September 28, 2024

@asci have you tried --no-prerender? If I recall correctly that's how to that with yargs

from preact-cli.

asci avatar asci commented on September 28, 2024

@rkostrzewski oh, thanks. looks like it helps

from preact-cli.

rkostrzewski avatar rkostrzewski commented on September 28, 2024

@thangngoc89 this should work in 1.3.0, could you verify?

from preact-cli.

thangngoc89 avatar thangngoc89 commented on September 28, 2024

@rkostrzewski I'm forking preact-cli right now, gonna make some PR to make it easier for me to switch back

from preact-cli.

reznord avatar reznord commented on September 28, 2024

@thangngoc89 is it working on Rafal's fork?

from preact-cli.

thangngoc89 avatar thangngoc89 commented on September 28, 2024

@reznord where is that fork? I have forked and check preact-cli in as a submodule inside my project.

from preact-cli.

thangngoc89 avatar thangngoc89 commented on September 28, 2024

Fixed in 1.3.0

from preact-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.