ChristopherBiscardi / new-toast-site

16 stars 2 forks source link

Known Issues #5

Open ChristopherBiscardi opened 4 years ago

ChristopherBiscardi commented 4 years ago
talves commented 4 years ago

Wrote this up then found this issue 😁. Not sure if it would help.

Should you be able to run yarn breadbox after you do a build?

Reason:

When trying to run yarn breadbox after a build, I get an error trying to resolve preact/hooks.js image

Temporary Resolutions:

Solution 1 - Shake & Bake 😉

"scripts": {
    "clean": "rm -rf public",
    "build": "yarn shake && yarn bake",
    "prepare": "yarn shake",
    "shake":  "yarn clean && yarn breadbox",
    "bake": "toast incremental",
    "breadbox": "breadbox --dest public/web_modules"
  },

Solution 2 - give snowpack some ❤

  "snowpack": {
    "installOptions": {
      "alias": {
        "react": "preact/compat",
        "preact/hooks": "preact/hooks/dist/hooks.module.js"  <------- added
      }
    },
    "knownEntrypoints": [
      "preact",
      "preact/hooks",
      "@emotion/core",
      "@mdx-js/preact",
      "react-helmet",
      "preact/compat"
    ]
  }
ChristopherBiscardi commented 4 years ago

The public directory needs to be ignored in the snowpack config