-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby): upgrade null-loader
#22410
Conversation
There are few breaking changes on the way - https://github.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md Will have to wait for #22400 to be able to use v3 of null-loader (because right now we have 8.0 support still) |
@pieh, as an option null-loader can be upgraded to v2 since v2 contains the fix for the problem I encountered and per my understanding v2 is node 8 compatible. btw, is there a better pattern how to exclude assets from build? lets assume there is a css file imported by a component, we want to include this file while in gatsby develop but exclude it during gatsby build |
We do plan to drop Node 8 tomorrow - we worked out most of CI problems today (but there can be delays), so if you are fine with holding to this PR a bit longer we can keep
This is probably best way to do this, but I'm pretty confused about aplying |
sounds great. I am totally fine
the styles are added in gatsby-browser.js and in components. we have some styles that are needed only while we are in gatsby develop (styles needed for admin ui), that is why I was looking for a way how to exclude those admin styles from static build |
not ideal, but you probably could try something like this (pretty sure if (process.env.BUILD_STAGE !== `build-javascript`) {
require(`./layout.css`)
} We use similar thing in gatsby ( https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/public-page-renderer.js ) |
Just note, that I don't think we document |
null-loader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! node 8 was just dropped so we can go ahead with this
null-loader
null-loader
Description
see #22409
Related Issues
Fixes #22409