Commit 6c88dfdf authored by Morgan Bazalgette's avatar Morgan Bazalgette Committed by Haelwenn

remove bundle analyzer, remove chunk hashes from css

parent 7f9e4f9e
......@@ -6,6 +6,15 @@ everything. This is my fork for the moment with the idea of making the mastofe
just as polished as the pleromafe. If you want to get access, open an issue or
hit me up at howl@social.zxq.co.
# Deployement
This is what you want to do to update the mastofe bundled with pleroma.
- Run ``build.sh`` at the root of this repo, you can set the ``TARGET`` environment variable if pleroma isn’t at ``../pleroma`` (default value of ``TARGET``)
- Go to pleroma repo:
- ``git add priv/static/sw.js priv/static/packs``
- ``git commit -m "update mastofe"``
# Development
I use a combination of the pleroma backend + yarn + nginx to do local
......
#!/bin/sh
TARGET="${TARGET:-../pleroma}" # Where pleroma’s repository is sitting
static_dir="priv/static" # Set this to instance/static when testing production build
if [[ ! -d "${TARGET}/${static_dir}" ]]
then
echo "Error: ${TARGET}/${static_dir} directory is missing, are you sure TARGET is set to a pleroma repository?"
echo "Info: TARGET=${TARGET}"
exit 1
fi
yarn install -D
rm -rf public/packs public/assets
env -i "PATH=$PATH" npm run build
cp public/assets/sw.js "${TARGET}/${static_dir}/sw.js"
rm -rf "${TARGET}/${static_dir}/packs"
cp -r public/packs "${TARGET}/${static_dir}/packs"
rm -rf "${TARGET}/${static_dir}/emoji/*.svg"
cp -r public/emoji/* "${TARGET}/${static_dir}/emoji"
......@@ -3,10 +3,8 @@
const path = require('path');
const { URL } = require('url');
const merge = require('webpack-merge');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const OfflinePlugin = require('offline-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const { output } = require('./configuration');
const sharedConfig = require('./shared');
......@@ -52,16 +50,6 @@ module.exports = merge(sharedConfig, {
},
plugins: [
new CompressionPlugin({
filename: '[path].gz[query]',
cache: true,
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/,
}),
new BundleAnalyzerPlugin({ // generates report.html
analyzerMode: 'static',
openAnalyzer: false,
logLevel: 'silent', // do not bother Webpacker, who runs with --json and parses stdout
}),
new OfflinePlugin({
publicPath: output.publicPath, // sw.js must be served from the root to avoid scope issues
caches: {
......@@ -85,7 +73,6 @@ module.exports = merge(sharedConfig, {
'/emoji/sheet_10.png', // used in emoji-mart
],
excludes: [
'**/*.gz',
'**/*.map',
'stats.json',
'report.html',
......
......@@ -100,8 +100,7 @@ module.exports = {
}
),
new MiniCssExtractPlugin({
filename: 'css/[name]-[contenthash:8].css',
chunkFilename: 'css/[name]-[contenthash:8].chunk.css',
filename: '[name].css',
}),
new AssetsManifestPlugin({
integrity: false,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment