Skip to content

Commit

Permalink
feat(nuxt): use bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Dec 5, 2021
1 parent 16b2056 commit 746ce6a
Show file tree
Hide file tree
Showing 11 changed files with 2,895 additions and 427 deletions.
18 changes: 4 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/nuxtjs
# Edit at https://www.toptal.com/developers/gitignore?templates=nuxtjs

### Nuxtjs ###
# dependencies
node_modules

# logs
npm-debug.log

# Nuxt build
*.log
.nuxt

# Nuxt generate
nuxt.d.ts
.output
.env
dist

# End of https://www.toptal.com/developers/gitignore/api/nuxtjs
2 changes: 1 addition & 1 deletion components/AppLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>

<script lang="ts">
import { defineComponent, PropType } from '@nuxtjs/composition-api'
import { defineComponent, PropType } from '#app'
export default defineComponent({
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import { defineComponent } from '#app'
export default defineComponent({
name: 'JonasThelemannLink',
Expand Down
2 changes: 1 addition & 1 deletion components/loader/LoaderImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<script lang="ts">
import { defineComponent, PropType } from '@nuxtjs/composition-api'
import { defineComponent, PropType } from '#app'
export default defineComponent({
props: {
Expand Down
2 changes: 1 addition & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import { defineComponent } from '#app'
export default defineComponent({
name: 'IndexPage',
Expand Down
21 changes: 12 additions & 9 deletions nuxt.config.js → nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { defineNuxtConfig } from '@nuxt/bridge'

import { BASE_URL } from './plugins/baseUrl'

const LOCALES = [
Expand All @@ -13,31 +15,32 @@ const LOCALES = [
},
]

export default {
export default defineNuxtConfig({
build: {
babel: {
plugins: [
['@babel/plugin-proposal-private-property-in-object', { loose: true }], // https://stackoverflow.com/a/68695763/4682621
],
presets({ _isServer }) {
presets() {
return [['@nuxt/babel-preset-app', { corejs: { version: 3 } }]]
},
},
extend(_config, _ctx) {},
extractCSS: true,
transpile: [/\.mjs$/],
transpile: ['moment', 'web-streams-polyfill'],
},
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
'@nuxtjs/composition-api/module',
['@nuxtjs/google-analytics', { id: 'UA-47285625-1' }],
'@nuxtjs/html-validator',
['@nuxtjs/moment', { locales: ['de'] }],
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
[
'@nuxtjs/tailwindcss',
{
viewer: false,
},
],
],
components: true,
generate: {
Expand Down Expand Up @@ -250,4 +253,4 @@ export default {
productionTip: false,
},
},
}
})
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"version": "4.7.8",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"dev": "nuxi",
"build": "nuxi generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint:style": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore",
"prepare": "if [[ -d '.git' && -d '.husky' ]]; then husky install && shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks; fi",
Expand All @@ -18,24 +16,25 @@
},
"dependencies": {
"@nuxt/http": "0.6.4",
"@nuxtjs/composition-api": "0.31.0",
"@nuxtjs/i18n": "7.2.0",
"@nuxtjs/robots": "2.5.0",
"@nuxtjs/sitemap": "2.4.0",
"@tailwindcss/typography": "0.4.1",
"consola": "2.15.3",
"core-js": "3.19.2",
"nuxt": "2.15.8",
"nuxt-edge": "latest",
"nuxt-healthcheck": "1.0.1",
"nuxt-helmet": "2.0.1"
},
"devDependencies": {
"@babel/eslint-parser": "7.16.3",
"@babel/runtime-corejs3": "7.16.3",
"@commitlint/cli": "15.0.0",
"@commitlint/config-conventional": "15.0.0",
"@intlify/eslint-plugin-vue-i18n": "1.2.0",
"@nuxt/babel-preset-app": "2.15.8",
"@nuxt/bridge": "npm:@nuxt/bridge-edge",
"@nuxt/types": "2.15.8",
"@nuxt/typescript-build": "2.1.0",
"@nuxtjs/eslint-config-typescript": "8.0.0",
"@nuxtjs/eslint-module": "3.0.2",
"@nuxtjs/google-analytics": "2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
import { defineComponent } from '@vue/composition-api'
import { Context } from '@nuxt/types'
const consola = require('consola')
import consola from 'consola'
export default defineComponent({
name: 'IndexPage',
Expand Down
2 changes: 1 addition & 1 deletion pages/legal-notice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</template>

<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import { defineComponent } from '#app'
export default defineComponent({
data() {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"node_modules",
".nuxt",
"dist"
]
],
"extends": "./.nuxt/tsconfig.json"
}

0 comments on commit 746ce6a

Please sign in to comment.