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(css): remove sideEffects package field #991

Merged
merged 3 commits into from
Dec 7, 2020

Conversation

chenxsan
Copy link
Contributor

@chenxsan chenxsan commented Dec 7, 2020

Summary

When using @docsearch/css with webpack like below:

import '@docsearch/css'

sideEffects: false would cause webpack to prune all the css.

I have to work around with a hack like this:

import styles from '@docsearch/css';
// do something with `styles` to keep it around.

Result

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

this change makes sense according to me, although I haven't yet checked it. The change should happen in a different file though

packages/docsearch-react/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

I think this is correct!

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Thanks!

@francoischalifour francoischalifour changed the title chore: remove sideEffects fix(css): remove sideEffects package field Dec 7, 2020
@francoischalifour francoischalifour merged commit 9216ffa into algolia:next Dec 7, 2020
@chenxsan chenxsan deleted the patch-1 branch December 7, 2020 10:32
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.

3 participants