Skip to content

Commit

Permalink
Fix CDN path
Browse files Browse the repository at this point in the history
  • Loading branch information
qrac committed May 30, 2024
1 parent 2322fc2 commit 3c7c89f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yakuhanjp-monorepo",
"version": "4.1.0",
"version": "4.1.1",
"private": true,
"homepage": "https://yakuhanjp.qranoko.jp",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/yakuhanjp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yakuhanjp",
"description": "Yakumono-Hankaku Fonts",
"version": "4.1.0",
"version": "4.1.1",
"type": "module",
"main": "dist/css/yakuhanjp.css",
"files": [
Expand Down
7 changes: 3 additions & 4 deletions packages/yakuhanjp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ function cdnPlugin(): Plugin {
if (chunk.type === "asset" && typeof chunk.source === "string") {
let cssContent = chunk.source
cssContent = cssContent.replace(
/(\.\.\/fonts\/[^\/]+\/[^\/]+\.woff2)/g,
(match) => {
const fontName = match.split("/").pop()
return `${cdnBasePath}${fontName}`
/(\.\.\/fonts\/([^\/]+)\/([^\/]+\.woff2))/g,
(match, p1, p2, p3) => {
return `${cdnBasePath}${p2}/${p3}`
}
)
const newFileName = path.join("cdn", path.basename(fileName))
Expand Down

0 comments on commit 3c7c89f

Please sign in to comment.