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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add styleExtensions #4671
Conversation
@@ -46,7 +46,7 @@ export default class Resolver { | |||
return resolve(this.options.srcDir, path) | |||
} | |||
|
|||
resolvePath(path, { alias, module } = {}) { | |||
resolvePath(path, { alias, module, isStyle } = {}) { |
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.
Maybe we should move to isXYZ
syntax generally for booleans here? 馃
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.
I like this convention 馃憤
Codecov Report
@@ Coverage Diff @@
## dev #4671 +/- ##
==========================================
+ Coverage 90.78% 90.82% +0.04%
==========================================
Files 67 67
Lines 2236 2224 -12
Branches 545 544 -1
==========================================
- Hits 2030 2020 -10
+ Misses 187 185 -2
Partials 19 19
Continue to review full report at Codecov.
|
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!
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.
Nice enhancement. But I don't see any reason adding complexity for handling option as a function or string unless a specific use case exists. replace or append merge strategy would be enough and more consistent. Modules has the opprotounity to modify options in any manner they need :)
@@ -46,7 +46,7 @@ export default class Resolver { | |||
return resolve(this.options.srcDir, path) | |||
} | |||
|
|||
resolvePath(path, { alias, module } = {}) { | |||
resolvePath(path, { alias, module, isStyle } = {}) { |
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.
I like this convention 馃憤
packages/config/src/options.js
Outdated
@@ -43,6 +43,21 @@ export function getNuxtConfig(_options) { | |||
options.extensions = [options.extensions] | |||
} | |||
|
|||
const styleExtensionDefaults = ['css', 'pcss', 'postcss', 'styl', 'stylus', 'scss', 'sass', 'less'] |
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.
If defaults ordering would be important I suggest mentioning it in the docs too :)
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.
Yeah, I'll create a doc PR afterwards anyway
Thanks for the heads up!
In your
css
array, you have to write the corresponding extension when providing your stylesheets. While transitioning from SCSS to PostCSS in several projects, I thought: "Why not completely omitting the extension as we do it for JS resolves 馃?"There we go!
Types of changes
Checklist: