-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Fix autoinstall of cssnano #2415
Fix autoinstall of cssnano #2415
Conversation
@@ -54,11 +54,8 @@ async function getConfig(asset) { | |||
} | |||
|
|||
if (asset.options.minify) { | |||
let [cssnano, {version}] = await Promise.all( | |||
['cssnano', 'cssnano/package.json'].map(name => | |||
localRequire(name, asset.name).catch(() => require(name)) |
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.
.catch(() => require(name))
What was that for?
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.
not sure, seems unnecessary. do you remember @DeMoorJasper?
Or this should be fixed in |
This is a fine fix for now. I do think we should fix the parsing of package names in |
-> #2425 |
↪️ Pull Request
Fixes autoinstalling of cssnano (previously, parcel tried to install the package "cssnano/package.json".
Fixes #2290, this seems to be a cleaner/easier fix than what was proposed there.
With this change,
localrequire("cssnano/package.json")
never fails, because it will only run after cssnano is installed.Should there be a test for this? If yes, how should that look like?
💻 Examples
🚨 Test instructions
Building any html file which imports a css file.
✔️ PR Todo