Talaxasy
Talaxasy
NNuxt
Created by Talaxasy on 4/1/2024 in #❓・help
useNuxtApp doesn't have my custom plugins
I've tried reload vscode, restart nuxt server, reinstall Vue extension - nothing works
3 replies
NNuxt
Created by Bootsmann on 5/23/2023 in #❓・help
azure
Try add config_file_location: "/" line to .yaml in the end. Add swa-cli.config.json to your root of project:
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"parakeet": {
"appLocation": "src/",
"outputLocation": "dist",
"appBuildCommand": "nuxt generate",
"run": "yarn dev",
"appDevserverUrl": "localhost:3000"
}
}
}
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"parakeet": {
"appLocation": "src/",
"outputLocation": "dist",
"appBuildCommand": "nuxt generate",
"run": "yarn dev",
"appDevserverUrl": "localhost:3000"
}
}
}
Add staticwebapp.config.json to root:
{
"platform": {
"apiRuntime": "node:16",
"apiDirectory": ".output/server",
"apiBuildCommand": "yarn run build",
"apiStartCommand": "yarn run nuxt generate && yarn run nuxt start",
"outputDirectory": ".output/public"
},
"routes": [
{
"route": "/index.html",
"redirect": "/"
},
{
"route": "/",
"rewrite": "/api/server"
}
],
"navigationFallback": {
"rewrite": "/api/server"
}
}
{
"platform": {
"apiRuntime": "node:16",
"apiDirectory": ".output/server",
"apiBuildCommand": "yarn run build",
"apiStartCommand": "yarn run nuxt generate && yarn run nuxt start",
"outputDirectory": ".output/public"
},
"routes": [
{
"route": "/index.html",
"redirect": "/"
},
{
"route": "/",
"rewrite": "/api/server"
}
],
"navigationFallback": {
"rewrite": "/api/server"
}
}
Idk, is it necessary or not but and also to root ecosystem.config.js:
module.exports = {
apps: [
{
name: 'Parakeet',
exec_mode: 'cluster',
instances: 'max', // Or a number of instances
script: './.output/server/index.mjs',
args: 'start',
node_args: '-r dotenv/config'
}
]
}
module.exports = {
apps: [
{
name: 'Parakeet',
exec_mode: 'cluster',
instances: 'max', // Or a number of instances
script: './.output/server/index.mjs',
args: 'start',
node_args: '-r dotenv/config'
}
]
}
3 replies
NNuxt
Created by Talaxasy on 5/19/2023 in #❓・help
How to use env variables inside /utils folder?
To be precise, I have this code: .env file:
CONSOLE_DEBUG="false"
CONSOLE_DEBUG="false"
src/utils/constants.ts:
export const isDev = process.env.NODE_ENV === 'development';
export const isConsoleDebug = process.env.CONSOLE_DEBUG
? process.env.CONSOLE_DEBUG === 'true'
: undefined;
export const isConsole =
typeof isConsoleDebug !== 'undefined' ? isConsoleDebug : isDev;
export const isDev = process.env.NODE_ENV === 'development';
export const isConsoleDebug = process.env.CONSOLE_DEBUG
? process.env.CONSOLE_DEBUG === 'true'
: undefined;
export const isConsole =
typeof isConsoleDebug !== 'undefined' ? isConsoleDebug : isDev;
src/utils/helpers.ts:
export const logger = isConsole
? console
: { info: () => {}, warn: () => {}, error: () => {} };
export const logger = isConsole
? console
: { info: () => {}, warn: () => {}, error: () => {} };
Then on the frontend I use my logger like this: logger.info('Page:', toJS(page.value));
3 replies
NNuxt
Created by Talaxasy on 4/17/2023 in #❓・help
From validation library
thanks for suggestions, i'd rather use vee-validate because of the good documentation, but the slime form looks nice too
14 replies
NNuxt
Created by Talaxasy on 4/17/2023 in #❓・help
From validation library
Seems like there is Vuelidate library, but not sure that is the best solution, maybe some zod...
14 replies
NNuxt
Created by Alexander Kim on 12/5/2022 in #❓・help
Route rules overriding
You can check it with "prerender": true in "*" and try to build project via "nuxi generate" and look if pages generated except "/news/**"
2 replies