-
Notifications
You must be signed in to change notification settings - Fork 18
v3.1.5: Fix #75 #76
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
v3.1.5: Fix #75 #76
Conversation
Add feature scoping
@@ -112,7 +112,7 @@ export const setup = (build, _options) => { | |||
const rpath = relative(buildRoot, path); | |||
const prefix = basename(rpath, extname(path)) | |||
.replace(/[^a-zA-Z0-9]/g, '-') | |||
.replace(/^\-*/, ''); | |||
.replace(/^-*/, ''); |
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.
Just removing an extraneous escape character
const cssOutputsMap = Object.entries(r.metafile?.outputs ?? {}) | ||
.reduce(/** @type {(m: Record<string, string>, o: any) => Record<string, string>} */(m, [o, {inputs}]) => { |
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.
Removing a typescript failure due to it not understanding the type of the accumulator. There could be a better solution to be quite honest.
animation: 3s linear slide-in; | ||
display: grid; | ||
grid-template: "image text"; |
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.
To test the hashing/not-hashing of the feature scoping controls.
@@ -19,7 +19,8 @@ import cssModulesPlugin from '../index.js'; | |||
plugins: [ | |||
cssModulesPlugin({ | |||
inject: '#my-custom-element-with-shadow-dom', | |||
emitDeclarationFile: true | |||
emitDeclarationFile: true, | |||
pattern: "__[hash]_[local]" |
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.
LightningCSS complains if the pattern doesn't end with [local]
when grid areas are being used. See: https://lightningcss.dev/css-modules.html#css-grid
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.
LGTM, thank you!
Add feature scoping control: https://lightningcss.dev/css-modules.html#turning-off-feature-scoping
Fixes #75