Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 4976537

Browse files
committed
feat: prepare for Nuxt 2.13
1 parent 23b2d5f commit 4976537

File tree

9 files changed

+684
-53
lines changed

9 files changed

+684
-53
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ yarn create nuxt-app <my-project>
7878
1. Choose rendering mode
7979
- [Universal (SSR / Static)](https://nuxtjs.org/guide/#server-rendered-universal-ssr-)
8080
- [SPA](https://nuxtjs.org/guide/#single-page-applications-spa-)
81+
1. Choose target
82+
- [Server (Node.js hosting)](https://nuxtjs.org/api/configuration-target)
83+
- [Static (Static/JAMStack hosting)](https://nuxtjs.org/api/configuration-target)
8184
1. Choose development tools
8285
- [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig)
8386
- [Semantic PR](https://probot.github.io/apps/semantic-pull-requests/)

packages/cna-template/template/nuxt/components/Logo.vue

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
</g>
1818
</svg>
1919
</template>
20+
2021
<style>
2122
.NuxtLogo {
2223
animation: 1s appear;

packages/cna-template/template/nuxt/layouts/default.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<nuxt />
3+
<Nuxt />
44
</div>
55
</template>
66

packages/cna-template/template/nuxt/nuxt.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export default {
88
*/
99
mode: '<%= mode %>',
1010
/*
11+
** Nuxt target
12+
** See https://nuxtjs.org/api/configuration-target
13+
*/
14+
target: '<%= target %>',
15+
/*
1116
** Headers of the page
1217
** See https://nuxtjs.org/api/configuration-head
1318
*/
@@ -68,6 +73,11 @@ export default {
6873
<%_ } _%>
6974
],
7075
/*
76+
** Auto import components
77+
** See https://nuxtjs.org/api/configuration-components
78+
*/
79+
components: true,
80+
/*
7181
** Nuxt.js dev-modules
7282
*/
7383
buildModules: [

packages/cna-template/template/nuxt/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"dev": "nuxt",
44
"build": "nuxt build",
55
"start": "nuxt start",
6-
"generate": "nuxt generate",
6+
"export": "nuxt export",
7+
"serve": "nuxt serve",
78
"lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
89
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore"
910
},

packages/cna-template/template/nuxt/pages/index.vue

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="container">
33
<div>
4-
<logo />
4+
<Logo />
55
<h1 class="title">
66
<%= name %>
77
</h1>
@@ -30,23 +30,12 @@
3030
<%_ if (typescript) { _%>
3131
<script lang="ts">
3232
import Vue from 'vue'
33-
import Logo from '~/components/Logo.vue'
3433

35-
export default Vue.extend({
36-
components: {
37-
Logo
38-
}
39-
})
34+
export default Vue.extend({})
4035
</script>
4136
<%_ } else { _%>
4237
<script>
43-
import Logo from '~/components/Logo.vue'
44-
45-
export default {
46-
components: {
47-
Logo
48-
}
49-
}
38+
export default {}
5039
</script>
5140
<%_ } _%>
5241

packages/create-nuxt-app/lib/prompts.js

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ module.exports = [
102102
],
103103
default: 'universal'
104104
},
105+
{
106+
name: 'target',
107+
message: 'Choose target',
108+
type: 'list',
109+
choices: [
110+
{ name: 'Server (Node.js hosting)', value: 'server' },
111+
{ name: 'Static (Static/JAMStack hosting)', value: 'static' }
112+
],
113+
default: 'server'
114+
},
105115
{
106116
name: 'devTools',
107117
message: 'Choose development tools',

0 commit comments

Comments
 (0)