Skip to content

Commit

Permalink
feat: prepare for Nuxt 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed May 18, 2020
1 parent 23b2d5f commit 4976537
Show file tree
Hide file tree
Showing 9 changed files with 684 additions and 53 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -78,6 +78,9 @@ yarn create nuxt-app <my-project>
1. Choose rendering mode
- [Universal (SSR / Static)](https://nuxtjs.org/guide/#server-rendered-universal-ssr-)
- [SPA](https://nuxtjs.org/guide/#single-page-applications-spa-)
1. Choose target
- [Server (Node.js hosting)](https://nuxtjs.org/api/configuration-target)
- [Static (Static/JAMStack hosting)](https://nuxtjs.org/api/configuration-target)
1. Choose development tools
- [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig)
- [Semantic PR](https://probot.github.io/apps/semantic-pull-requests/)
Expand Down
1 change: 1 addition & 0 deletions packages/cna-template/template/nuxt/components/Logo.vue
Expand Up @@ -17,6 +17,7 @@
</g>
</svg>
</template>

<style>
.NuxtLogo {
animation: 1s appear;
Expand Down
2 changes: 1 addition & 1 deletion packages/cna-template/template/nuxt/layouts/default.vue
@@ -1,6 +1,6 @@
<template>
<div>
<nuxt />
<Nuxt />
</div>
</template>

Expand Down
10 changes: 10 additions & 0 deletions packages/cna-template/template/nuxt/nuxt.config.js
Expand Up @@ -8,6 +8,11 @@ export default {
*/
mode: '<%= mode %>',
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: '<%= target %>',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
Expand Down Expand Up @@ -68,6 +73,11 @@ export default {
<%_ } _%>
],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: [
Expand Down
3 changes: 2 additions & 1 deletion packages/cna-template/template/nuxt/package.json
Expand Up @@ -3,7 +3,8 @@
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"export": "nuxt export",
"serve": "nuxt serve",
"lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore"
},
Expand Down
17 changes: 3 additions & 14 deletions packages/cna-template/template/nuxt/pages/index.vue
@@ -1,7 +1,7 @@
<template>
<div class="container">
<div>
<logo />
<Logo />
<h1 class="title">
<%= name %>
</h1>
Expand Down Expand Up @@ -30,23 +30,12 @@
<%_ if (typescript) { _%>
<script lang="ts">
import Vue from 'vue'
import Logo from '~/components/Logo.vue'
export default Vue.extend({
components: {
Logo
}
})
export default Vue.extend({})
</script>
<%_ } else { _%>
<script>
import Logo from '~/components/Logo.vue'
export default {
components: {
Logo
}
}
export default {}
</script>
<%_ } _%>

Expand Down
10 changes: 10 additions & 0 deletions packages/create-nuxt-app/lib/prompts.js
Expand Up @@ -102,6 +102,16 @@ module.exports = [
],
default: 'universal'
},
{
name: 'target',
message: 'Choose target',
type: 'list',
choices: [
{ name: 'Server (Node.js hosting)', value: 'server' },
{ name: 'Static (Static/JAMStack hosting)', value: 'static' }
],
default: 'server'
},
{
name: 'devTools',
message: 'Choose development tools',
Expand Down

0 comments on commit 4976537

Please sign in to comment.