Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize build #64

Merged
merged 10 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/assets/css/fontawesome.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ $fa-font-path : "../../node_modules/@fortawesome/fontawesome-free/webfonts";
@import '../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '../../node_modules/@fortawesome/fontawesome-free/scss/solid.scss';
// @import '../../node_modules/@fortawesome/fontawesome-free/scss/brands.scss';
// @import '../../node_modules/@fortawesome/fontawesome-free/scss/regular.scss';
// @import '../../node_modules/@fortawesome/fontawesome-free/scss/regular.scss';
6 changes: 3 additions & 3 deletions frontend/assets/css/main.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import './fontawesome.scss';
@import './materialdesign.scss';
// @import './fontawesome.scss';
// @import './materialdesign.scss';


.skip-navbar{
Expand All @@ -12,4 +12,4 @@
.fullscreen-div{
height: 100%;
width: 100%;
}
}
9 changes: 9 additions & 0 deletions frontend/components/UX/NavbarFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,18 @@
<span>
{{ btn.title[locale] }}
</span>

<v-icon>
{{ btn.icon }}
</v-icon>

<!-- <v-icon>
fas fa-th
</v-icon> -->

<!-- <font-awesome-icon :icon="btn.icon" /> -->
<!-- <fa icon="th" /> -->

</v-btn>
</v-bottom-navigation>
</v-footer>
Expand Down
10 changes: 8 additions & 2 deletions frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ console.log(
process.env.NUXT_ENV_APP_TITLE
)

const APP_VERSION = 'v.0.13.linting - linting frontend code'
const APP_VERSION = 'v.0.14.analyze - analyze build + treeshake icons'

// - - - - - - - - - - - - - - - - - - - - - - - -
// CONFIGS FROM...
Expand Down Expand Up @@ -274,7 +274,10 @@ export default {
content: process.env.NUXT_ENV_APP_TITLE || 'ODAMAP'
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ href: 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', rel: 'stylesheet' }
]
},

// for build or dev
Expand Down Expand Up @@ -322,6 +325,7 @@ export default {
{ src: '~/plugins/mapbox', mode: 'client' },
{ src: '~/plugins/apexCharts', mode: 'client' },
{ src: '~/plugins/matomo', mode: 'client' }
// { src: '~/plugins/icons.js', ssr: false }
],

/*
Expand All @@ -338,6 +342,7 @@ export default {
'nuxt-i18n',
// '~/modules/objectFromPath',
'@nuxtjs/device'

],

i18n: {
Expand Down Expand Up @@ -373,6 +378,7 @@ export default {
** Build configuration
*/
build: {
analyze: true,
JulienParis marked this conversation as resolved.
Show resolved Hide resolved
transpile: ['vue-mapbox'],
// plugins: [
// new webpack.ProvidePlugin({
Expand Down
26 changes: 26 additions & 0 deletions frontend/package-lock.json

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

4 changes: 4 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Julien_P",
"private": true,
"scripts": {
"analyze": "nuxt build --analyze",
JulienParis marked this conversation as resolved.
Show resolved Hide resolved
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lintfix": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
"dev": "nuxt",
Expand All @@ -14,6 +15,9 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
JulienParis marked this conversation as resolved.
Show resolved Hide resolved
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/vue-fontawesome": "^0.1.9",
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/device": "^1.2.7",
"@turf/bbox": "^6.0.1",
Expand Down
38 changes: 38 additions & 0 deletions frontend/plugins/icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// ... all fontawesome icons ...
import Vue from 'vue'
import Vuetify from 'vuetify'

import '@fortawesome/fontawesome-free/css/all.min.css'
Vue.use(Vuetify, {
iconfont: 'fa'
})

/*
// ... only some icons
// cf : https://stackoverflow.com/questions/52030435/fontawesome-with-vuetify-how-to-include-font-awesome-icons-within-the-v-icon-c

import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' // Integration
// import {
// faHome,
// faMap,
// faTh,
// faChartBar,
// faDatabase
// } from '@fortawesome/free-solid-svg-icons'
import { fas } from '@fortawesome/free-solid-svg-icons'

Vue.component('font-awesome-icon', FontAwesomeIcon)
// library.add(
// faHome,
// faMap,
// faTh,
// faChartBar,
// faDatabase
// )
library.add(fas)

Vue.use(Vuetify, {
iconfont: 'faSvg'
})
*/