-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat: support css @import
hmr
#281
Conversation
test/test.js
Outdated
// await updateFile('css-@import/testCssImportBoundary.scss', (content) => | ||
// content.replace('red', 'rgb(0, 0, 0)') | ||
// ) | ||
// await expectByPolling(() => getComputedColor(el), 'rgb(0, 0, 0)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is ok when run dev and test in broswer.But it fail in test.I don't know why.So I'm need you take a look. Thanks!
This is important for support css module with preprocessors.But I meet this error.And I almost implement it in this pr....I will work that after.
src/node/utils/cssUtils.ts
Outdated
return css | ||
} | ||
return await postcss().use(cssImport()).process(css, { from: filePath }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This maybe can be combinate with compileStyleAsync
use postcss-easy-import
plugin(I meet some error with this). And it need compiler-sfc
export postcss
messages.
So I only implement this...
Another thing is your test for To properly support |
@yyx990803. This plugin look like is only parse // index.js
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var atImport = require("postcss-import")
// css to be processed
var css = fs.readFileSync("./a.css", "utf8")
// process css
postcss()
.use(atImport())
.process(css, {
// `from` option is needed here
from: "./a.css?a=1"
})
.then(function (result) {
var output = result.css
console.log(result)
console.log(output)
})
This will output this below.
|
I check the implement of So we maybe can't merge |
=。=you are right.I get syntax error. |
close #9