Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from YIO-Remote/feature/optimise-build-size
Browse files Browse the repository at this point in the history
Bundle Size Optimisation
  • Loading branch information
martonborzak committed May 9, 2020
2 parents a58ab7d + 353c8b6 commit 3a242d8
Show file tree
Hide file tree
Showing 15 changed files with 2,754 additions and 2,198 deletions.
11 changes: 11 additions & 0 deletions .config/webpack.config.analyse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const merge = require('webpack-merge');
const production = require('./webpack.config.prod');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = merge(production, {
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'server'
})
]
});
3 changes: 2 additions & 1 deletion .config/webpack.config.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ module.exports = {
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
template: 'index.html'
template: 'index.html',
favicon: '../assets/images/favicon-32.png'
}),
new webpack.DefinePlugin({
'process.env.__VERSION__': JSON.stringify(pkg.version)
Expand Down
13 changes: 11 additions & 2 deletions .config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.config.common');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserJSPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');

module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
devtool: false,
optimization: {
minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
},
module: {
rules: [
{
Expand All @@ -25,8 +32,10 @@ module.exports = merge(common, {
]
},
plugins: [
new CompressionPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new MiniCssExtractPlugin({
filename: 'style.css'
})
]
]
});
Binary file added assets/images/favicon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/styles/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
@font-face {
font-family: '#{$icomoon-font-family}';
src:
url('#{$icomoon-font-path}/#{$icomoon-font-family}.ttf?6y2exq') format('truetype'),
url('#{$icomoon-font-path}/#{$icomoon-font-family}.woff?6y2exq') format('woff'),
url('#{$icomoon-font-path}/#{$icomoon-font-family}.ttf') format('truetype'),
url('#{$icomoon-font-path}/#{$icomoon-font-family}.woff?6y2exq') format('woff'),
url('#{$icomoon-font-path}/#{$icomoon-font-family}.svg?6y2exq##{$icomoon-font-family}') format('svg');
font-weight: normal;
font-style: normal;
Expand Down
Loading

0 comments on commit 3a242d8

Please sign in to comment.