Closed Jenniferyingni closed 3 years ago
This line https://github.com/anncwb/vite-plugin-theme/blob/56ab4340e428c3c4f2789706295a208441503be3/src/antdDarkThemePlugin.ts#L100
injectTo should be head
head
body-prepend inject dark-theme.css before <!DOCTYPE html> in html, this leads to DocType ignored in production mode and cause style differences in production mode.
body-prepend
<!DOCTYPE html>
<link disabled id="__VITE_PLUGIN_THEME-ANTD_DARK_THEME_LINK__" rel="alternate stylesheet" href="/assets/app-antd-dark-theme-style.e3b0c442.css"> <!DOCTYPE html> <html lang="en"> </html>
The same cause as this issue
https://github.com/vitejs/vite/issues/221
This line https://github.com/anncwb/vite-plugin-theme/blob/56ab4340e428c3c4f2789706295a208441503be3/src/antdDarkThemePlugin.ts#L100
injectTo should be
head
body-prepend
inject dark-theme.css before<!DOCTYPE html>
in html, this leads to DocType ignored in production mode and cause style differences in production mode.The same cause as this issue
https://github.com/vitejs/vite/issues/221