-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore/upgrade greenwood v0.30.0 #98
Conversation
❌ Deploy Preview for practical-fermat-fa2c48 failed.
|
Noticed that when combined with the PostCSS plugin-import plugin, FA was being inlined into the final CSS bundles (which is expected because that is its job, hah!) body: '/*!\n' +
' * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome\n' +
' * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n' +
' */\n' +
'/* FONT PATH\n' +
' * -------------------------- */\n' +
'@font-face {\n' +
" font-family: 'FontAwesome';\n" +
" src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');\n" +
" src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');\n" +
' font-weight: normal;\n' +
' font-style: normal;\n' +
'}\n' +
'.fa {\n' + It means Greenwood's CSS optimization has no reference for where to start looking and because of no node_modules signal in the pathname, fails to look it up and completely breaks on lookup, which is obviously not good. Error: ENOENT: no such file or directory, open '/Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/src/fonts/fontawesome-webfont.eot'
at Object.openSync (node:fs:596:3)
at Object.readFileSync (node:fs:464:35)
at Object.enter (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js:56:36)
at walkNode (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:169:36)
at List.walkReducer (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:195:61)
at List.reduce (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/utils/List.js:174:22)
at Object.Value (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:103:31)
at walkNode (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:180:41)
at Object.Declaration (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:108:28)
at walkNode (file:///Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/node_modules/css-tree/lib/walker/create.js:180:41) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/src/fonts/fontawesome-webfont.eot' Should at least guard for this with a warning message, which I have patched in for now and will need to upstream if (fs.existsSync(locationUrl.pathname)) {
// do all the fancy stuff
optimizedCss += `url('${basePath}${hashedRoot}')`;
} else {
// TODO handle 'data:', e.g. Unable to optimize /Users/owenbuckley/Workspace/analogstudiosri/www.analogstudios.net/src/data:image/svg+xml;charset=utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%204'%3E%3Cpath%20stroke='%23fff'%20d='M0%202h4'/%3E%3C/svg%3E.
console.warn(`Unable to optimize ${locationUrl.pathname}. You may need to manually copy this file into the output directory.`);
optimizedCss += `url('${value}')`;
} |
Looks like there might a race condition happening somewhere related to
Hmm, so no after upgrading and pulling in changes for ProjectEvergreen/greenwood#1268 I can't seem to reproduce this issue anymore after restoring the |
Sooooo... now Netlify redirects seems to be failing now? 😳 Local proxy was fine, and so is production? |
Related Issue
N / A
Summary of Changes
TODO
url
optimization breaking on unresolvable assets - chore/upgrade greenwood v0.30.0 #98 (comment)postinstall
🤦♂️inline
optimization "breaks" prod Constructable StyleSheets and thus causes a 404? (and not stripping<link>
tags either?) - I think it's just cause the inline will not cause anemit
? So maybe need to check when bundle mapping the assets optimization status and look it up if so?ga
plugin not working now in localserve
(race condition?) - seems fineUpstreams
url
optimization and better handling fordata:
- bug/issue 1199 gracefully handle unresolvable asset URLs during CSS optimization ProjectEvergreen/greenwood#1235