Skip to content

Commit

Permalink
perf: enable preload webpack plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed May 24, 2023
1 parent af7ab2d commit 08816df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@vue/cli-plugin-unit-jest": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"@vue/eslint-config-airbnb": "^7.0.0",
"@vue/preload-webpack-plugin": "^2.0.0",
"@vue/test-utils": "^1.3.5",
"@vue/vue2-jest": "^27.0.0",
"babel-jest": "^27.5.1",
Expand Down
7 changes: 7 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');
const addClassesToSVGElement = require('svgo/plugins/addClassesToSVGElement').fn;
const PreloadPlugin = require('@vue/preload-webpack-plugin');
const { version: sdkVersion } = require('./node_modules/@aeternity/aepp-sdk/package.json');

process.env.VUE_APP_VERSION = process.env.npm_package_version;
Expand Down Expand Up @@ -82,6 +83,12 @@ module.exports = {
config.plugins.delete('pwa');
config.plugins.delete('workbox');
}

// TODO: remove after fixing https://github.com/vuejs/vue-cli/issues/7206
config.plugin('prefetch').after('html').use(PreloadPlugin, [{
rel: 'prefetch',
include: 'asyncChunks',
}]);
},
pwa: {
workboxPluginMode: 'InjectManifest',
Expand Down

0 comments on commit 08816df

Please sign in to comment.