Skip to content

Commit

Permalink
feat: dynamic HTML template (#58)
Browse files Browse the repository at this point in the history
close #57
  • Loading branch information
RSS1102 authored May 7, 2024
1 parent d9f4216 commit 934f16e
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 2 deletions.
7 changes: 7 additions & 0 deletions farm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export default defineConfig({
},
],
'farm-plugin-remove-console',
["@jstors/farm-plugin-html-template",
{
template: path.resolve(__dirname, 'index.html'),
data: {
title: 'Farm React Admin',
}
}],
less(),
postcss(),
],
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<title>Farm React Admin</title>
<title>${title}$</title>
</head>

<body>
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@farmfe/js-plugin-less": "^1.7.0",
"@farmfe/js-plugin-postcss": "^1.6.0",
"@farmfe/plugin-react": "^1.0.1",
"@jstors/farm-plugin-html-template": "^0.0.2",
"@types/react": "^18.2.78",
"@types/react-dom": "^18.2.25",
"autoprefixer": "^10.4.19",
Expand All @@ -48,6 +49,8 @@
"vite-plugin-pages": "^0.32.1"
},
"lint-staged": {
"*": ["pnpm check"]
"*": [
"pnpm check"
]
}
}
98 changes: 98 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 934f16e

Please sign in to comment.