build(nuxt): add settings to deploy to github pages

This commit is contained in:
Julien
2018-10-02 17:39:36 +01:00
parent d0eb50839c
commit 5ada8ed63e
3 changed files with 2417 additions and 2383 deletions

View File

@@ -1,3 +1,20 @@
/**************************************************************************
* ENVIRONMENT CONFIGURATIONS
***************************************************************************/
const router =
process.env.NODE_ENV === "production"
? {
router: {
base: "/dark-mode/"
}
}
: {};
/**************************************************************************
* EXPORT
***************************************************************************/
module.exports = {
head: {
title: "Awesome Cheatsheets",
@@ -13,14 +30,18 @@ module.exports = {
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
},
env: {
baseUrl:
process.env.NODE_ENV === "production"
? "https://lecoupa.github.io/awesome-cheatsheets/"
: "http://localhost:3000"
},
css: ["normalize.css/normalize.css"],
plugins: [{ src: "@/plugins/global.js" }],
modules: [
[
"@nuxtjs/google-analytics",
@@ -40,6 +61,7 @@ module.exports = {
]
]
],
build: {
extend(config, { isDev, isClient }) {
if (isDev && isClient) {
@@ -52,5 +74,7 @@ module.exports = {
}
},
postcss: [require("autoprefixer")()]
}
},
...router
};