Open ChristopherBiscardi opened 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?
When trying to run yarn breadbox
after a build, I get an error trying to resolve preact/hooks.js
"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"
},
"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"
]
}
The public directory needs to be ignored in the snowpack config
toast incremental
(yarn build) once, then installing any package, theprepare
script will fail trying to look for/preact/hooks.js
. This is because the prepare command is trying to scan the public/ directory. Runningrm -rf public
or ignoring the warning should both work for now.withCache
(in toast.js) is aggressive. You'll have torm -rf .cache
when adding new data. In the future this API and associated APIs will not rely on using the raw filesystem and this problem will go away.