Skip to content

Commit fc8ddbf

Browse files
committed
Optimize import
1 parent 570ad36 commit fc8ddbf

File tree

7 files changed

+57
-147
lines changed

7 files changed

+57
-147
lines changed

Cargo.lock

Lines changed: 39 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/landing/src/app/layout.tsx

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import './markdown.css'
21
import 'sanitize.css'
32

43
import { css, globalCss, ThemeScript } from '@devup-ui/react'
@@ -25,59 +24,8 @@ export const metadata: Metadata = {
2524
},
2625
}
2726

28-
// table {
29-
// border-collapse: collapse;
30-
// border-spacing: 0;
31-
// border: 1px solid var(--text);
32-
// color: var(--text, #2F2F2F);
33-
34-
// /* Desktop/bodyReg */
35-
// font-family: Pretendard;
36-
// font-size: 16px;
37-
// font-style: normal;
38-
// font-weight: 400;
39-
// line-height: 150%; /* 24px */
40-
// letter-spacing: -0.48px;
41-
// }
42-
43-
// code {
44-
// font-family: D2Coding;
45-
// font-size: 13px;
46-
// font-style: normal;
47-
// font-weight: 700;
48-
// line-height: 1.5;
49-
// letter-spacing: -0.03em;
50-
// }
51-
52-
// @media (min-width: 1280px) {
53-
// code {
54-
// font-size: 15px;
55-
// }
56-
// }
57-
58-
// th, td {
59-
// border: 1px solid var(--text);
60-
// padding: 6px 13px;
61-
// }
62-
63-
// pre {
64-
// border-radius: 10px;
65-
// }
66-
67-
// console.log('wtf')
68-
69-
// globalCss`
70-
// body {
71-
// }
72-
// `
73-
// globalCss({
74-
// body: {
75-
// // bg: 'red !important',
76-
// },
77-
// })
78-
7927
globalCss({
80-
imports: ['http://cdn.jsdelivr.net/gh/joungkyun/font-d2coding/d2coding.css'],
28+
imports: ['https://cdn.jsdelivr.net/gh/joungkyun/font-d2coding/d2coding.css'],
8129
table: {
8230
borderCollapse: 'collapse',
8331
borderSpacing: 0,
@@ -91,7 +39,7 @@ globalCss({
9139
letterSpacing: '-0.48px',
9240
},
9341
code: {
94-
fontFamily: 'D2Coding 궁서',
42+
fontFamily: 'D2Coding',
9543
fontSize: ['13px', '15px'],
9644
fontStyle: 'normal',
9745
fontWeight: 700,

apps/landing/src/app/markdown.css

Lines changed: 0 additions & 41 deletions
This file was deleted.

libs/extractor/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
oxc_parser = "0.75.0"
8-
oxc_syntax = "0.75.0"
9-
oxc_span = "0.75.0"
10-
oxc_allocator = "0.75.0"
11-
oxc_ast = "0.75.0"
12-
oxc_ast_visit = "0.75.0"
13-
oxc_codegen = "0.75.0"
7+
oxc_parser = "0.77.0"
8+
oxc_syntax = "0.77.0"
9+
oxc_span = "0.77.0"
10+
oxc_allocator = "0.77.0"
11+
oxc_ast = "0.77.0"
12+
oxc_ast_visit = "0.77.0"
13+
oxc_codegen = "0.77.0"
1414
css = { path = "../css" }
1515
phf = "0.12"
1616
strum = "0.27.1"

libs/sheet/src/lib.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,13 @@ impl StyleSheet {
199199
}
200200

201201
pub fn create_css(&self) -> String {
202-
let mut css = self.theme.to_css();
203-
204-
css.push_str(
205-
&self
206-
.imports
207-
.iter()
208-
.map(|(_, import)| format!("@import \"{}\";\n", import))
209-
.collect::<Vec<String>>()
210-
.join(""),
211-
);
202+
let mut css = self
203+
.imports
204+
.iter()
205+
.map(|(_, import)| format!("@import \"{}\";", import))
206+
.collect::<Vec<String>>()
207+
.join("");
208+
css.push_str(&self.theme.to_css());
212209

213210
for (_, _css) in self.css.iter() {
214211
for _css in _css.iter() {

libs/sheet/src/snapshots/sheet__tests__create_css_with_imports.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: libs/sheet/src/lib.rs
33
expression: sheet.create_css()
44
---
5-
"@import \"@devup-ui/core/css/global.css\";\n@import \"@devup-ui/core/css/global2.css\";\n@import \"@devup-ui/core/css/global3.css\";\n@import \"@devup-ui/core/css/global4.css\";\n"
5+
"@import \"@devup-ui/core/css/global.css\";@import \"@devup-ui/core/css/global2.css\";@import \"@devup-ui/core/css/global3.css\";@import \"@devup-ui/core/css/global4.css\";"

packages/webpack-plugin/src/loader.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ const devupUILoader: RawLoaderDefinitionFunction<DevupUILoaderOptions> =
3333
id,
3434
source.toString(),
3535
libPackage,
36-
(rel.startsWith('./') ? rel : `./${rel}`) +
37-
(watch ? `?${Date.now()}` : ''),
36+
rel.startsWith('./') ? rel : `./${rel}`,
3837
)
3938
const sourceMap = map ? JSON.parse(map) : null
4039
if (css && watch) {

0 commit comments

Comments
 (0)