Open titieo opened 3 years ago
This is the log when disable built-in optimize and use webpack instead, with this config:
'@snowpack/plugin-webpack',
{
outputPattern: {
css: 'index.css',
js: 'index.js',
},
extendConfig: (config) => {
config.plugins.push(/* ... */);
return config;
},
sourceMap: false,
},
Thanks for raising. Our optimizations do cause issues with certain configurations currently. We’re going to be doing work soon to improve this story and resolve many bugs like this.
This seems to be related to packageOptions.source
when it is set to remote.
The optimiser does not seem to be able to detect the filetype of the packages that are generated under _snowpack/pkg
because they do not have extensions (eg. build/snowpack/pkg/react
).
Should all snowpack issues be closed?
Why?
@joshgoebel I thought vite replaced snowpack in astro.
I didn't think Snowpack was astro specific though... but it would be helpful if someone provided an update on the project status for sure.
Ah, true enough! I was only thinking in the context of Astro. Never mind me :-)
Bug Report Quick Checklist
Describe the bug
When I run
cross-env TAILWIND_DISABLE_TOUCH=true NODE_ENV=production snowpack build
with built-in optimize, it work but it doesn't when using built-in optimizeTo Reproduce
My repo is here (snowpack branch)
git clone -b snowpack https://github.com/loctran016/eleventy-kickstart-blog.git
yarn install
yarn build
Expected behavior
The Build process work with built-in optimize enabled
Anything else?
Log is here
```bash PS D:\frontend-template> yarn build [10:43:45] [snowpack] config.mount[D:\frontend-template\src\images]: mounted directory does not exist. [10:43:45] [snowpack] ! building files... [10:43:50] [eleventy] Writing public/robots.txt from ./src/robots.ejs. [10:43:50] [eleventy] Writing public/sitemap.xml from ./src/sitemap.njk. [10:43:50] [eleventy] LazyImages - found 1 images in public/index.html [10:43:50] [eleventy] LazyImages - processed 1 images in public/index.html [10:43:50] [eleventy] Writing public/tags/index.html from ./src/tags-list.njk. [10:43:50] [eleventy] Writing public/tags/allslides/index.html from ./src/tags.njk. Writing public/content/posts/hi/index.html from ./src/content/posts/hi.md. Writing public/index.html from ./src/index.njk. [10:43:50] [eleventy] LazyImages - found 1 images in public/tags/allposts/index.html [10:43:50] [eleventy] LazyImages - processed 1 images in public/tags/allposts/index.html [10:43:51] [eleventy] Writing public/tags/allposts/index.html from ./src/tags.njk. [10:43:51] [eleventy] LazyImages - found 1 images in public/tags/allpages/index.html [10:43:51] [eleventy] LazyImages - processed 1 images in public/tags/allpages/index.html [10:43:51] [eleventy] Writing public/tags/allpages/index.html from ./src/tags.njk. [10:43:51] [eleventy] Wrote 8 files in 1.74 seconds (v0.12.1) [10:43:51] [eleventy] Command completed. warn - You have enabled the JIT engine which is currently in preview. warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time. ✔︎ Including: base, components, themes[21], utilities [10:43:52] [snowpack] import overlayscrollbars@latest → https://pkg.snowpack.dev/overlayscrollbars [10:43:53] [snowpack] pin dependency to this version: `snowpack add overlayscrollbars` [10:43:53] [snowpack] import @fortawesome/fontawesome-free@latest → https://pkg.snowpack.dev/@fortawesome/fontawesome-free [10:43:53] [snowpack] pin dependency to this version: `snowpack add @fortawesome/fontawesome-free` [10:43:53] [snowpack] import alpinejs@latest → https://pkg.snowpack.dev/alpinejs [10:43:53] [snowpack] pin dependency to this version: `snowpack add alpinejs` [10:43:53] [snowpack] import theme-change@latest → https://pkg.snowpack.dev/theme-change [10:43:53] [snowpack] pin dependency to this version: `snowpack add theme-change` [10:43:53] [snowpack] ✔ files built. [7.44s] [10:43:53] [snowpack] ! building dependencies... [10:43:53] [snowpack] ✔ dependencies built. [0.00s] [10:43:53] [snowpack] ! writing to disk... [10:43:53] [snowpack] ✔ write complete. [0.08s] [10:43:53] [snowpack] ▶ Build Complete! PS D:\frontend-template> yarn build [10:44:14] [snowpack] config.mount[D:\frontend-template\src\images]: mounted directory does not exist. [10:44:14] [snowpack] ! building files... [10:44:19] [eleventy] Writing public/robots.txt from ./src/robots.ejs. [10:44:19] [eleventy] Writing public/sitemap.xml from ./src/sitemap.njk. [10:44:19] [eleventy] LazyImages - found 1 images in public/index.html [10:44:19] [eleventy] LazyImages - processed 1 images in public/index.html [10:44:19] [eleventy] Writing public/tags/index.html from ./src/tags-list.njk. [10:44:19] [eleventy] Writing public/tags/allslides/index.html from ./src/tags.njk. Writing public/content/posts/hi/index.html from ./src/content/posts/hi.md. [10:44:19] [eleventy] Writing public/index.html from ./src/index.njk. [10:44:19] [eleventy] LazyImages - found 1 images in public/tags/allposts/index.html [10:44:19] [eleventy] LazyImages - processed 1 images in public/tags/allposts/index.html [10:44:20] [eleventy] Writing public/tags/allposts/index.html from ./src/tags.njk. [10:44:20] [eleventy] LazyImages - found 1 images in public/tags/allpages/index.html [10:44:20] [eleventy] LazyImages - processed 1 images in public/tags/allpages/index.html [10:44:20] [eleventy] Writing public/tags/allpages/index.html from ./src/tags.njk. [10:44:20] [eleventy] Wrote 8 files in 1.68 seconds (v0.12.1) [10:44:20] [eleventy] Command completed. warn - You have enabled the JIT engine which is currently in preview. warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time. 🌼 DaisyUI components 1.4.0 https://github.com/saadeghi/daisyui ✔︎ Including: base, components, themes[21], utilities [10:44:21] [snowpack] import overlayscrollbars@latest → https://pkg.snowpack.dev/overlayscrollbars [10:44:21] [snowpack] pin dependency to this version: `snowpack add overlayscrollbars` [10:44:22] [snowpack] import @fortawesome/fontawesome-free@latest → https://pkg.snowpack.dev/@fortawesome/fontawesome-free [10:44:22] [snowpack] pin dependency to this version: `snowpack add @fortawesome/fontawesome-free` [10:44:23] [snowpack] import alpinejs@latest → https://pkg.snowpack.dev/alpinejs [10:44:23] [snowpack] pin dependency to this version: `snowpack add alpinejs` [10:44:24] [snowpack] import theme-change@latest → https://pkg.snowpack.dev/theme-change [10:44:24] [snowpack] pin dependency to this version: `snowpack add theme-change` [10:44:25] [snowpack] ✔ files built. [11.53s] [10:44:25] [snowpack] ! building dependencies... [10:44:25] [snowpack] ✔ dependencies built. [0.00s] [10:44:25] [snowpack] ! writing to disk... [10:44:25] [snowpack] ✔ write complete. [0.05s] [10:44:25] [snowpack] ! optimizing build... > build/scripts/index.js:2:7: error: Do not know how to load path: build/_snowpack/pkg/@fortawesome/fontawesome-free/js/all 2 │ import '../_snowpack/pkg/@fortawesome/fontawesome-free/js/all'; // Import Packages ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > build/scripts/index.js:6:28: error: Do not know how to load path: build/_snowpack/pkg/theme-change 6 │ import { themeChange } from '../_snowpack/pkg/theme-change'; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > build/scripts/index.js:5:19: error: Do not know how to load path: build/_snowpack/pkg/alpinejs 5 │ import Alpine from '../_snowpack/pkg/alpinejs'; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ > build/_snowpack/pkg/overlayscrollbars/js/OverlayScrollbars.min.js:15:14: error: Could not resolve "/_snowpack/pkg/-/overlayscrollbars@v1.13.1-ceoseDeKYXrLImSC7nQ2/dist=es2020,mode=imports/unoptimized/js/OverlayScrollbars.min.js" 15 │ export * from '/_snowpack/pkg/-/overlayscrollbars@v1.13.1-ceoseDeKYXrLImSC7nQ2/dist=es2020,mode=imports/unoptimized/js/OverlayScroll... ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > build/styles/index.css:1:44017: warning: All "@import" rules must come first 1 │ ...rop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}@import "../_snowpack/pkg/overlayscrollbars/css/OverlayScrollbars.mi... ╵ ~~~~~~~ build/styles/index.css:1:0: note: This rule cannot come before an "@import" rule 1 │ html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system... ╵ ^ [10:44:26] [snowpack] Build failed with 4 errors: build/_snowpack/pkg/overlayscrollbars/js/OverlayScrollbars.min.js:15:14: error: Could not resolve "/_snowpack/pkg/-/overlayscrollbars@v1.13.1-ceoseDeKYXrLImSC7nQ2/dist=es2020,mode=imports/unoptimized/js/OverlayScrollbars.min.js" build/scripts/index.js:2:7: error: Do not know how to load path: build/_snowpack/pkg/@fortawesome/fontawesome-free/js/all build/scripts/index.js:5:19: error: Do not know how to load path: build/_snowpack/pkg/alpinejs build/scripts/index.js:6:28: error: Do not know how to load path: build/_snowpack/pkg/theme-change [10:44:26] [snowpack] Error: Build failed with 4 errors: build/_snowpack/pkg/overlayscrollbars/js/OverlayScrollbars.min.js:15:14: error: Could not resolve "/_snowpack/pkg/-/overlayscrollbars@v1.13.1-ceoseDeKYXrLImSC7nQ2/dist=es2020,mode=imports/unoptimized/js/OverlayScrollbars.min.js" build/scripts/index.js:2:7: error: Do not know how to load path: build/_snowpack/pkg/@fortawesome/fontawesome-free/js/all build/scripts/index.js:5:19: error: Do not know how to load path: build/_snowpack/pkg/alpinejs build/scripts/index.js:6:28: error: Do not know how to load path: build/_snowpack/pkg/theme-change at failureErrorWithLog (D:\frontend-template\node_modules\esbuild\lib\main.js:1224:15) at buildResponseToResult (D:\frontend-template\node_modules\esbuild\lib\main.js:936:32) at D:\frontend-template\node_modules\esbuild\lib\main.js:1035:20 at D:\frontend-template\node_modules\esbuild\lib\main.js:568:9 at handleIncomingPacket (D:\frontend-template\node_modules\esbuild\lib\main.js:657:9) at Socket.readFromStdout (D:\frontend-template\node_modules\esbuild\lib\main.js:535:7) at Socket.emit (events.js:376:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Socket.Readable.push (internal/streams/readable.js:223:10) at Pipe.onStreamRead (internal/stream_base_commons.js:188:23) ```Here is a video as well:
https://user-images.githubusercontent.com/64778285/123194832-54269480-d4d1-11eb-9f3c-bc75339682be.mp4