Skip to content

Commit 9fc1c0a

Browse files
committed
feat: added compression for build
1 parent 41f3031 commit 9fc1c0a

3 files changed

Lines changed: 88 additions & 68 deletions

File tree

nuxt.config.js

Lines changed: 69 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,84 @@
11
import colors from 'vuetify/es5/util/colors'
22

33
export default {
4-
telemetry: false,
5-
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
6-
ssr: false,
4+
telemetry: false,
5+
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
6+
ssr: false,
77

8-
// Target: https://go.nuxtjs.dev/config-target
9-
target: 'static',
8+
// Target: https://go.nuxtjs.dev/config-target
9+
target: 'static',
1010

11-
// Global page headers: https://go.nuxtjs.dev/config-head
12-
head: {
13-
titleTemplate: 'Course Offering - %s',
14-
title: 'KFU',
15-
meta: [
16-
{ charset: 'utf-8' },
17-
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
18-
{ hid: 'description', name: 'description', content: '' },
19-
{ name: 'format-detection', content: 'telephone=no' },
20-
],
21-
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
22-
},
11+
// Global page headers: https://go.nuxtjs.dev/config-head
12+
head: {
13+
titleTemplate: 'Course Offering - %s',
14+
title: 'KFU',
15+
meta: [
16+
{ charset: 'utf-8' },
17+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
18+
{ hid: 'description', name: 'description', content: '' },
19+
{ name: 'format-detection', content: 'telephone=no' },
20+
],
21+
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
22+
},
2323

24-
// Global CSS: https://go.nuxtjs.dev/config-css
25-
css: [],
24+
// Global CSS: https://go.nuxtjs.dev/config-css
25+
css: [],
2626

27-
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
28-
plugins: [],
27+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
28+
plugins: [],
2929

30-
// Auto import components: https://go.nuxtjs.dev/config-components
31-
components: true,
30+
// Auto import components: https://go.nuxtjs.dev/config-components
31+
components: true,
3232

33-
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
34-
buildModules: [
35-
// https://go.nuxtjs.dev/typescript
36-
'@nuxt/typescript-build',
37-
// https://go.nuxtjs.dev/vuetify
38-
'@nuxtjs/vuetify',
39-
],
33+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
34+
buildModules: [
35+
// https://go.nuxtjs.dev/typescript
36+
'@nuxt/typescript-build',
37+
// https://go.nuxtjs.dev/vuetify
38+
'@nuxtjs/vuetify',
39+
'nuxt-compress'
40+
],
4041

41-
// Modules: https://go.nuxtjs.dev/config-modules
42-
modules: [
43-
// https://go.nuxtjs.dev/axios
44-
'@nuxtjs/axios',
45-
// https://go.nuxtjs.dev/pwa
46-
'@nuxtjs/pwa',
47-
],
42+
// Modules: https://go.nuxtjs.dev/config-modules
43+
modules: [
44+
// https://go.nuxtjs.dev/axios
45+
'@nuxtjs/axios',
46+
// https://go.nuxtjs.dev/pwa
47+
'@nuxtjs/pwa',
48+
],
4849

49-
// Axios module configuration: https://go.nuxtjs.dev/config-axios
50-
axios: {
51-
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
52-
baseURL: '/',
53-
},
50+
// Axios module configuration: https://go.nuxtjs.dev/config-axios
51+
axios: {
52+
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
53+
baseURL: '/',
54+
},
5455

55-
// PWA module configuration: https://go.nuxtjs.dev/pwa
56-
pwa: {
57-
manifest: {
58-
lang: 'en',
59-
},
60-
},
56+
// PWA module configuration: https://go.nuxtjs.dev/pwa
57+
pwa: {
58+
manifest: {
59+
lang: 'en',
60+
},
61+
},
6162

62-
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
63-
vuetify: {
64-
customVariables: ['~/assets/variables.scss'],
65-
theme: {
66-
dark: true,
67-
themes: {
68-
dark: {
69-
primary: colors.blue.darken2,
70-
accent: colors.grey.darken3,
71-
secondary: colors.amber.darken3,
72-
info: colors.teal.lighten1,
73-
warning: colors.amber.base,
74-
error: colors.deepOrange.accent4,
75-
success: colors.green.accent3,
76-
},
77-
},
78-
},
79-
},
63+
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
64+
vuetify: {
65+
customVariables: ['~/assets/variables.scss'],
66+
theme: {
67+
dark: true,
68+
themes: {
69+
dark: {
70+
primary: colors.blue.darken2,
71+
accent: colors.grey.darken3,
72+
secondary: colors.amber.darken3,
73+
info: colors.teal.lighten1,
74+
warning: colors.amber.base,
75+
error: colors.deepOrange.accent4,
76+
success: colors.green.accent3,
77+
},
78+
},
79+
},
80+
},
8081

81-
// Build Configuration: https://go.nuxtjs.dev/config-build
82-
build: {},
82+
// Build Configuration: https://go.nuxtjs.dev/config-build
83+
build: {},
8384
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"eslint-plugin-nuxt": "^3.1.0",
4040
"eslint-plugin-vue": "^8.2.0",
4141
"jest": "^27.4.4",
42+
"nuxt-compress": "^5.0.0",
4243
"prettier": "^2.5.1",
4344
"ts-jest": "^27.1.1",
4445
"vue-jest": "^3.0.4"

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,6 +3630,17 @@ compressible@~2.0.16:
36303630
dependencies:
36313631
mime-db ">= 1.43.0 < 2"
36323632

3633+
compression-webpack-plugin@^6.1.1:
3634+
version "6.1.1"
3635+
resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-6.1.1.tgz#ae8e4b2ffdb7396bb776e66918d751a20d8ccf0e"
3636+
integrity sha512-BEHft9M6lwOqVIQFMS/YJGmeCYXVOakC5KzQk05TFpMBlODByh1qNsZCWjUBxCQhUP9x0WfGidxTbGkjbWO/TQ==
3637+
dependencies:
3638+
cacache "^15.0.5"
3639+
find-cache-dir "^3.3.1"
3640+
schema-utils "^3.0.0"
3641+
serialize-javascript "^5.0.1"
3642+
webpack-sources "^1.4.3"
3643+
36333644
compression@^1.7.4:
36343645
version "1.7.4"
36353646
resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
@@ -7619,6 +7630,13 @@ num2fraction@^1.2.2:
76197630
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
76207631
integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=
76217632

7633+
nuxt-compress@^5.0.0:
7634+
version "5.0.0"
7635+
resolved "https://registry.yarnpkg.com/nuxt-compress/-/nuxt-compress-5.0.0.tgz#386e40804351cb41222f6078c83b3572b5e049f1"
7636+
integrity sha512-KxsYzgRTMJhqQfGfgLbam0gOTw8GtmrhJhQjUfcShCmBpVaL2sFM6urOKW3I/fIx+aRvF9uE0FZCFviF1TLZww==
7637+
dependencies:
7638+
compression-webpack-plugin "^6.1.1"
7639+
76227640
nuxt@^2.15.8:
76237641
version "2.15.8"
76247642
resolved "https://registry.yarnpkg.com/nuxt/-/nuxt-2.15.8.tgz#946cba46bdaaf0e3918aa27fd9ea0fed8ed303b0"

0 commit comments

Comments
 (0)