Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
revisit nuxt.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdmaster committed Nov 29, 2021
1 parent 0c589c1 commit 9ece14e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path'
import { Configuration } from 'webpack'
import { NuxtConfig } from '@nuxt/types'
import { NuxtWebpackEnv } from '@nuxt/types/config/build'
import { NuxtOptionsRouter } from '@nuxt/types/config/router'
import { NuxtOptionsGenerateRoute } from '@nuxt/types/config/generate'
/* eslint-disable-next-line no-restricted-imports */
import i18n from './nuxt-i18n.config'
/* eslint-disable-next-line no-unused-vars */
Expand Down Expand Up @@ -215,15 +215,15 @@ const config: NuxtConfig = {
},
generate: {
fallback: 'true',
routes(): Array<NuxtOptionsRouter> {
routes(): Array<NuxtOptionsGenerateRoute> {
const locales = ['en', 'zh-cn', 'zh-tw', 'ko', 'ja-basic']
/* eslint-disable @typescript-eslint/no-explicit-any */
const pages = cardData.map((v: any) => v.path)
const localizedPages = locales
.map((locale) => pages.map((page: any) => `/${locale}${page}`))
.reduce((a, b) => [...a, ...b], [])
/* eslint-enable @typescript-eslint/no-explicit-any */
return { ...pages, ...localizedPages }
return [...pages, ...localizedPages]
},
},
/*
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"dev-no-axe": "cross-env NODE_ENV=dev-no-axe NODE_OPTIONS=node-options nuxt dev",
"build": "nuxt generate",
"start": "cross-env NODE_ENV=production nuxt start",
"generate:deploy": "cross-env GENERATE_ENV=production NODE_OPTIONS=node-options nuxt build && yarn functions:build",
"generate:dev": "cross-env GENERATE_ENV=dev NODE_OPTIONS=node-options nuxt build && yarn functions:build",
"generate": "eslint \"./**/*.{js,ts,jsx,tsx,vue}\" && nuxt generate",
"generate:deploy": "cross-env GENERATE_ENV=production NODE_OPTIONS=node-options nuxt build && yarn functions:build && yarn build",
"generate:dev": "cross-env GENERATE_ENV=dev NODE_OPTIONS=node-options nuxt build && yarn functions:build && yarn build",
"generate": "eslint \"./**/*.{js,ts,jsx,tsx,vue}\" && yarn build",
"test": "echo 'skip tests (there is no test)'",
"lint": "eslint \"./**/*.{js,ts,jsx,tsx,vue}\"",
"lint:fix": "eslint \"./**/*.{js,ts,jsx,tsx,vue}\" --fix",
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10492,6 +10492,17 @@ [email protected]:
schema-utils "^3.0.0"
semver "^7.3.2"

[email protected]:
version "10.2.0"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.2.0.tgz#3d64c1590f911013b3fa48a0b22a83d5e1494716"
integrity sha512-kUceLzC1gIHz0zNJPpqRsJyisWatGYNFRmv2CKZK2/ngMJgLqxTbXwe/hJ85luyvZkgqU3VlJ33UVF2T/0g6mw==
dependencies:
klona "^2.0.4"
loader-utils "^2.0.0"
neo-async "^2.6.2"
schema-utils "^3.0.0"
semver "^7.3.2"

sass-loader@^12.3.0:
version "12.3.0"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-12.3.0.tgz#93278981c189c36a58cbfc37d4b9cef0cdc02871"
Expand Down

0 comments on commit 9ece14e

Please sign in to comment.