Skip to content

Commit

Permalink
put global css at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Jan 27, 2023
1 parent 8045367 commit c0fa25e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/nextjs/babel/next-app-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ module.exports = function (babel, options, dirname) {
},
exit(path) {
if (globalCss.length) {
path.unshiftContainer(
// 将 global css 置于内部组件样式之后,以便内部组件样式可以覆盖全局样式
path.pushContainer(
'body',
globalCss
)
Expand Down
4 changes: 2 additions & 2 deletions tests/babel/next-app-plugin/__fixtures__/basic/output.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "../../app.scss";
import "../../app.less";
import Head from "next/head";
import TaroApp from "./app";

Expand All @@ -18,3 +16,5 @@ const MyApp = ({ Component, pageProps }) => (
);

export default MyApp;
import "../../app.scss";
import "../../app.less";

0 comments on commit c0fa25e

Please sign in to comment.