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

upgrade htmlnano dep #2506

Merged
merged 1 commit into from Jan 4, 2019
Merged

Conversation

devmao
Copy link
Contributor

@devmao devmao commented Jan 4, 2019

↪️ Pull Request

See issue #2505

💻 Examples

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@devongovett devongovett merged commit 08398bd into parcel-bundler:master Jan 4, 2019
@ai
Copy link

ai commented Jan 4, 2019

This htmlnano update is pretty important, because:

  1. Old cssnano (in htmlnano) brings old PostCSS and create conflicts like parcel build fails with "semantic.min.css:undefined:undefined: decl.moveTo is not a function" #2505
  2. Old cssnano brings old Browserslist which will throw error on unknown queries from browerslist config.

Also, these old dependencies print warnings in Yarn:

warning parcel-bundler > htmlnano > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

These warnings are bad in contrast with awesome DX of Parcel.

@ai
Copy link

ai commented Jan 4, 2019

:D Oops, I left the comment just a few second after PR was merged. Good work @devongovett 👍. Sorry for the noise.

@mischnic
Copy link
Member

mischnic commented Jan 4, 2019

These two test are now failing:

it('should minify HTML in production mode', async function() {
await bundle(path.join(__dirname, '/integration/htmlnano/index.html'), {
production: true
});
let html = await fs.readFile(
path.join(__dirname, '/dist/index.html'),
'utf8'
);
assert(html.includes('Other page'));
assert(!html.includes('\n'));
});

it('should not minify default values inside HTML in production mode', async function() {
await bundle(
path.join(__dirname, '/integration/htmlnano-defaults-form/index.html'),
{
production: true
}
);
let html = await fs.readFile(
path.join(__dirname, '/dist/index.html'),
'utf8'
);
assert(html.includes('<input type="text">'));
assert(!html.includes('\n'));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants