1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-29 00:06:31 +00:00

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
};

4769
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,12 +6,12 @@
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"build": "NODE_ENV=production nuxt build",
"start": "nuxt start",
"generate": "NODE_ENV=production nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint",
"deploy": "git subtree push --prefix dist origin gh-pages"
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
},
"dependencies": {
"@nuxtjs/google-analytics": "^2.0.2",
@ -30,6 +30,7 @@
"nuxt-sass-resources-loader": "^2.0.5",
"pug": "^2.0.3",
"pug-plain-loader": "^1.0.0",
"push-dir": "^0.4.1",
"sass-loader": "^7.1.0"
}
}