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

test: css modules @import hmr #314

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

underfin
Copy link
Member

No description provided.

test('SFC <style module> w/ @import', async () => {
const el = await page.$('#sfc-style-css-module-at-import')
expect(await getComputedColor(el)).toBe('rgb(255, 0, 0)')
if (!isBuild) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This build will get error.I check it and it is maybe caused by rollup-plugin-vue.

content.replace('green', 'rgb(0, 0, 0)')
)
await expectByPolling(() => getComputedColor(el), 'rgb(0, 0, 0)')
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This dev will get error.I don't know why.It will work within browser on dev.

@@ -79,7 +79,6 @@ export const cssPlugin: ServerPlugin = ({ root, app, watcher, resolver }) => {
// it cannot be handled as normal css because the js exports may change
if (filePath.endsWith('.module.css')) {
moduleCssUpdate(filePath)
return
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a fix. When A improt B.B import C and C has changed. let it can bubbling with C -> B -> A.

@yyx990803 yyx990803 force-pushed the test-css-module-hmr-@import branch from 2402baf to 5dc90e9 Compare June 4, 2020 18:25
@yyx990803 yyx990803 merged commit 35c3a27 into vitejs:master Jun 4, 2020
@underfin underfin deleted the test-css-module-hmr-@import branch June 5, 2020 02:39
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.

2 participants