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

Minification #35

Merged
merged 12 commits into from
Mar 19, 2019
Merged

Minification #35

merged 12 commits into from
Mar 19, 2019

Conversation

Igorbek
Copy link
Owner

@Igorbek Igorbek commented Mar 5, 2019

This adds experimental support of minify option.

The test cases were mostly taken from Babel plugin and tried to align results.
A few discrepancies I found:

  • doesn't ignore unquoted urls -- I'm not convinced they are really used anywhere
  • emitting space after ', ", ) -- it seems css/scss works fine with it (like url(..)no-repeat)

Implements #14

- fixtures are taken from babel plugin
- cases are in fixtures
- snapshots are in baselines
- use jest-specific-snapshot
- add `minify` option (default `false)
- start minifying
- still there're issues
styled.div \`bla (\`;
// ignores even unescaped URLs
// \`https://test.com\`
styled.div \`https:\`;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't work

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it is needed... waiting more feedback

styled.div \`https:\`;
// removes multi-line comments
// \`this is a test\`
styled.div \`this is atest\`;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaceismissing

src/__tests__/baselines/minification/simple.ts.baseline Outdated Show resolved Hide resolved
src/__tests__/baselines/minification/simple.ts.baseline Outdated Show resolved Hide resolved
@Igorbek Igorbek changed the title WIP - Minification Minification Mar 6, 2019
@Igorbek Igorbek mentioned this pull request Mar 6, 2019
@Igorbek Igorbek added this to the Release 1.4 milestone Mar 6, 2019
@Igorbek Igorbek merged commit 4e4dac8 into master Mar 19, 2019
@Igorbek Igorbek deleted the minification branch March 19, 2019 15:25
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.

1 participant