Skip to content

Commit 0c2148c

Browse files
authored
Workaround fomantic build issue (#10655)
This blows up the fomantic CSS by around 500kB, but I see no other way. Ref: #10653
1 parent a528189 commit 0c2148c

File tree

3 files changed

+156
-3
lines changed

3 files changed

+156
-3
lines changed

package-lock.json

Lines changed: 149 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@babel/preset-env": "7.8.4",
2525
"@babel/runtime": "7.8.4",
2626
"babel-loader": "8.0.6",
27+
"copy-webpack-plugin": "5.1.1",
2728
"core-js": "3.6.4",
2829
"css-loader": "3.4.2",
2930
"cssnano": "4.1.10",

webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const cssnano = require('cssnano');
22
const fastGlob = require('fast-glob');
3+
const CopyPlugin = require('copy-webpack-plugin');
34
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
45
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
56
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
@@ -191,14 +192,18 @@ module.exports = {
191192
new SpriteLoaderPlugin({
192193
plainSprite: true,
193194
}),
195+
new CopyPlugin([
196+
// workaround for https://github.com/go-gitea/gitea/issues/10653
197+
{ from: 'node_modules/fomantic-ui/dist/semantic.min.css', to: 'fomantic/semantic.min.css' },
198+
]),
194199
],
195200
performance: {
196201
hints: isProduction ? 'warning' : false,
197202
maxEntrypointSize: 512000,
198203
maxAssetSize: 512000,
199204
assetFilter: (filename) => {
200205
if (filename.endsWith('.map')) return false;
201-
if (['js/swagger.js', 'js/highlight.js'].includes(filename)) return false;
206+
if (['js/swagger.js', 'js/highlight.js', 'fomantic/semantic.min.css'].includes(filename)) return false;
202207
return true;
203208
},
204209
},

0 commit comments

Comments
 (0)