Git Product home page Git Product logo

Comments (3)

elite174 avatar elite174 commented on July 18, 2024

Ok, I found that I need to add solidOptions: { generate: "ssr", hydratable: true }, to build options to make it work in astro, however now it doesn't hydrate on the client. How to make it work?..

from rollup-preset-solid.

elite174 avatar elite174 commented on July 18, 2024

As I understood, I need to generate two outputs:

  1. for web (I guess, esm might be enough)
  2. for server with solidOptions: { generate: "ssr", hydratable: true } (esm, cjs)
  3. Update package.json with
"exports: {
   ".": {
        "node": "server path",
        "browser": "browser path",
        "import": "browser path",
        "require": "server path"
        // "solid": "???" - this line breaks everything
   }
}"

So I needed smth like this:

withSolid([
  {
      input: "src/index.ts",
      targets: ["esm"]
  },
  {
      input: "src/index.ts",
      targets: ["esm", "cjs"],
      solidOptions: { generate: "ssr", hydratable: true }
  },
])

How to get a good folder structure in this case? When I try to do this, it builds everything into dist/index without splitting to esm, cjs folders.

from rollup-preset-solid.

elite174 avatar elite174 commented on July 18, 2024

My issue was the pnpm-lock file.

from rollup-preset-solid.

Related Issues (11)

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.