mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 03:39:25 +02:00
Smaller CSS with purge CSS (130kb removed)
This commit is contained in:
parent
e1e6a73a79
commit
7ed3a24723
3 changed files with 86 additions and 3 deletions
|
@ -1,10 +1,22 @@
|
|||
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const webpack = require('webpack');
|
||||
const PurgecssPlugin = require('purgecss-webpack-plugin')
|
||||
const glob = require('glob-all')
|
||||
const path = require('path')
|
||||
|
||||
let plugins = [
|
||||
// do not include moment.js locales since it's quite heavy
|
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||
// Remove unused CSS using purgecss. See https://github.com/FullHuman/purgecss
|
||||
// for more information about purgecss.
|
||||
new PurgecssPlugin({
|
||||
paths: glob.sync([
|
||||
path.join(__dirname, './public/index.html'),
|
||||
path.join(__dirname, './**/*.vue'),
|
||||
path.join(__dirname, './src/**/*.js')
|
||||
])
|
||||
}),
|
||||
]
|
||||
if (process.env.BUNDLE_ANALYZE === '1') {
|
||||
plugins.push(new BundleAnalyzerPlugin())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue