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 no-important entry resolve #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wangcheng
Copy link

@wangcheng wangcheng commented Apr 19, 2019

If I use import {css} from 'aphrodite/no-important' in a ES module file, bundle tools like Rollup will resolve aphrodite/no-important to node_modules/aphrodite/no-important.js and then node_modules/aphrodite/lib/no-important.js which is not a ES module. To make things worse, rollup-plugin-commonjs cannot resolve named import (import {X} from 'x') for CommonJS modules.

A workaround is to use import {css} from 'aphrodite/es/no-important'. However this doesn't work for 'universal' code because ES module cannot be resolved in Node environment without being transpiled.

This change will let module resolver find package.json file in node_modules/aphrodite/no-important directory.

@khanbot
Copy link

khanbot commented Apr 19, 2019

Hey @wangcheng678,

Thanks for the PR! Mind signing our Contributor License Agreement?

When you've done so, go ahead and comment [clabot:check] and I'll check again.

Yours truly,
khanbot

@wangcheng
Copy link
Author

[clabot:check]

@khanbot
Copy link

khanbot commented Apr 19, 2019

CLA signature looks good 👍

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

2 participants