Skip to content
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

Merged
merged 1 commit into from Dec 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/core/parcel-bundler/src/transforms/postcss.js
Expand Up @@ -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))
Copy link
Member Author

@mischnic mischnic Dec 14, 2018

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?

Copy link
Member

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?

)
);
let cssnano = await localRequire('cssnano', asset.name);
let {version} = await localRequire('cssnano/package.json', asset.name);
config.plugins.push(
cssnano(
(await asset.getConfig(['cssnano.config.js'])) || {
Expand Down