-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add watch support for stylesheets in packages #8380
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ const exists = ( filename ) => { | |
|
||
// Exclude deceitful source-like files, such as editor swap files. | ||
const isSourceFile = ( filename ) => { | ||
return /.\.js$/.test( filename ); | ||
return /.\.(js|scss)$/.test( filename ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we'd need some kind of rule excluding the components package scss from being watched, since that will end up being watched by both webpack and this script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine :) it will generate a new CSS for the package but not use it in the webpack build. |
||
}; | ||
|
||
const rebuild = ( filename ) => filesToBuild.set( filename, true ); | ||
|
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.
In another PR #8287 I have the use-case for multiple SASS entry points (multiple CSS outputs) per package. Do you have some ideas on how this would play together?
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.
The simplest way I can think of is to add some kind of config, potentially as a custom property to the package.json that could be picked up by the build scripts:
Either that or some kind of naming convention e.g.
styles.main.scss
.I think the config idea is safer.