Remove lightningcss (#29070)
Remove lightningcss and minify with esbuild again. The size of output CSS will increase by around 1.4%, but I think it's worth it to allow building gitea in more cases like the one in the linked issue. We can reconsider once lightningcss becomes more stable. Fixes: https://github.com/go-gitea/gitea/issues/29058
This commit is contained in:
302
package-lock.json
generated
302
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,6 @@
|
|||||||
"jquery": "3.7.1",
|
"jquery": "3.7.1",
|
||||||
"katex": "0.16.9",
|
"katex": "0.16.9",
|
||||||
"license-checker-webpack-plugin": "0.2.1",
|
"license-checker-webpack-plugin": "0.2.1",
|
||||||
"lightningcss-loader": "2.1.0",
|
|
||||||
"mermaid": "10.7.0",
|
"mermaid": "10.7.0",
|
||||||
"mini-css-extract-plugin": "2.8.0",
|
"mini-css-extract-plugin": "2.8.0",
|
||||||
"minimatch": "9.0.3",
|
"minimatch": "9.0.3",
|
||||||
|
@ -55,12 +55,6 @@ const filterCssImport = (url, ...args) => {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// in case lightningcss fails to load, fall back to esbuild for css minify
|
|
||||||
let LightningCssMinifyPlugin;
|
|
||||||
try {
|
|
||||||
({LightningCssMinifyPlugin} = await import('lightningcss-loader'));
|
|
||||||
} catch {}
|
|
||||||
|
|
||||||
/** @type {import("webpack").Configuration} */
|
/** @type {import("webpack").Configuration} */
|
||||||
export default {
|
export default {
|
||||||
mode: isProduction ? 'production' : 'development',
|
mode: isProduction ? 'production' : 'development',
|
||||||
@ -106,12 +100,9 @@ export default {
|
|||||||
new EsbuildPlugin({
|
new EsbuildPlugin({
|
||||||
target: 'es2020',
|
target: 'es2020',
|
||||||
minify: true,
|
minify: true,
|
||||||
css: !LightningCssMinifyPlugin,
|
css: true,
|
||||||
legalComments: 'none',
|
legalComments: 'none',
|
||||||
}),
|
}),
|
||||||
LightningCssMinifyPlugin && new LightningCssMinifyPlugin({
|
|
||||||
sourceMap: sourceMaps === 'true',
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: 'async',
|
chunks: 'async',
|
||||||
|
Reference in New Issue
Block a user