Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Commit

Permalink
feat: upgrade to windicss v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hannoeru committed Mar 8, 2021
1 parent 464b08f commit a7c7b6e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 113 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,18 @@
"dependencies": {
"loader-utils": "^2.0.0",
"magic-string": "^0.25.7",
"postcss": "^8.2.6",
"postcss-nested": "^5.0.3",
"windicss": "^2.2.0"
"windicss": "^2.3.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.4.1",
"@rollup/plugin-sucrase": "^3.1.0",
"@rollup/plugin-typescript": "^8.2.0",
"@types/loader-utils": "^2.0.1",
"@types/node": "^14.14.31",
"rollup": "^2.39.1",
"@types/node": "^14.14.32",
"rollup": "^2.40.0",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.1.0",
"typescript": "^4.2.2"
"typescript": "^4.2.3"
}
}
143 changes: 41 additions & 102 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ export default function (this: loader.LoaderContext, content:string) {
if (styleBlocks) {
styleBlocks.forEach(async style => {
let styleStr = style.replace(/<\/?style[^>]*>/g, "");
if (!process.env.BROWSER) {
const postcssPlugins = [(await import('postcss-nested')).default()]
const result = await((await import('postcss')).default(postcssPlugins).process(styleStr, { from: undefined }));
styleStr = result.css
}
(REGEXP.isGlobalStyle.test(style)? globalStyles : scopedStyles).push(new CSSParser(styleStr, processor).parse());
});
content = content.replace(REGEXP.matchStyle, "");
Expand Down

0 comments on commit a7c7b6e

Please sign in to comment.