1
0
Fork 0
forked from forgejo/forgejo

Workaround fomantic build issue (#10655)

This blows up the fomantic CSS by around 500kB, but I see no other way.

Ref: https://github.com/go-gitea/gitea/issues/10653
This commit is contained in:
silverwind 2020-03-07 13:54:44 +01:00 committed by GitHub
parent a5281895c7
commit 0c2148c037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 156 additions and 3 deletions

View file

@ -1,5 +1,6 @@
const cssnano = require('cssnano');
const fastGlob = require('fast-glob');
const CopyPlugin = require('copy-webpack-plugin');
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
@ -191,6 +192,10 @@ module.exports = {
new SpriteLoaderPlugin({
plainSprite: true,
}),
new CopyPlugin([
// workaround for https://github.com/go-gitea/gitea/issues/10653
{ from: 'node_modules/fomantic-ui/dist/semantic.min.css', to: 'fomantic/semantic.min.css' },
]),
],
performance: {
hints: isProduction ? 'warning' : false,
@ -198,7 +203,7 @@ module.exports = {
maxAssetSize: 512000,
assetFilter: (filename) => {
if (filename.endsWith('.map')) return false;
if (['js/swagger.js', 'js/highlight.js'].includes(filename)) return false;
if (['js/swagger.js', 'js/highlight.js', 'fomantic/semantic.min.css'].includes(filename)) return false;
return true;
},
},