aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-05-30 14:10:36 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-30 20:20:47 +0200
commitd838a5c6d7ddf0b0e2b449882dfddbabe8181ab3 (patch)
tree63776c77915103288e2f59165d8c55b125422fe4
parent28e28e9305bb4bad55a4423422455c048cae6909 (diff)
downloadsonarqube-d838a5c6d7ddf0b0e2b449882dfddbabe8181ab3.tar.gz
sonarqube-d838a5c6d7ddf0b0e2b449882dfddbabe8181ab3.zip
SONAR-10672 Avoid async css chunks (#294)
-rw-r--r--server/sonar-web/config/webpack.config.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/server/sonar-web/config/webpack.config.js b/server/sonar-web/config/webpack.config.js
index 30cccdbd7ae..5e89c7f0e2f 100644
--- a/server/sonar-web/config/webpack.config.js
+++ b/server/sonar-web/config/webpack.config.js
@@ -67,12 +67,20 @@ module.exports = ({ production = true }) => ({
]
},
{
+ // extract styles from 'app/' into separate file
test: /\.css$/,
+ include: path.resolve(__dirname, '../src/main/js/app/styles'),
use: [
production ? MiniCssExtractPlugin.loader : 'style-loader',
utils.cssLoader({ production }),
utils.postcssLoader()
- ].filter(Boolean)
+ ]
+ },
+ {
+ // inline all other styles
+ test: /\.css$/,
+ exclude: path.resolve(__dirname, '../src/main/js/app/styles'),
+ use: ['style-loader', utils.cssLoader({ production }), utils.postcssLoader()]
},
{
test: /\.md$/,
@@ -84,7 +92,7 @@ module.exports = ({ production = true }) => ({
test: /\.directory-loader\.js$/,
loader: path.resolve(__dirname, 'documentation-loader/index.js')
}
- ].filter(Boolean)
+ ]
},
plugins: [
// `allowExternal: true` to remove files outside of the current dir
@@ -139,7 +147,7 @@ module.exports = ({ production = true }) => ({
performance: production
? {
hints: 'error',
- maxEntrypointSize: 700000, // ~700kb, recommended: 250kb
+ maxEntrypointSize: 710000, // ~700kb, recommended: 250kb
maxAssetSize: 400000 // ~400kb, recommended: 250kb
}
: undefined