Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
Nuxt js. ¿Es posible establecer una ruta personalizada para los archivos js que se generaron en la carpeta _nuxt?

Recientemente comencé un proyecto con Nuxt js. Pero debido a que la empresa usa el mismo servidor con otra aplicación, y la ruta URL https://my-company.com/_nuxt/ URL ya utilizada por otra aplicación, tengo que agregar /customprefix/ a la ruta de la aplicación. Entonces, la URL de ruta esperada es https://my-company.com/customprefix/_nuxt/ .

Ya intenté agregar publicPath como se menciona en la respuesta aceptada de esta pregunta y también crear una carpeta llamada customprefix en la raíz de la aplicación, pero los archivos aún se generan en https://my-company.com/_nuxt/

Aquí está mi archivo nuxt.config.js actual

 export default { // Global page headers: https://go.nuxtjs.dev/config-head build:{ publicPath: "/customprefix" }, static:{ prefix: true }, head: { titleTemplate: '%s - nuxt-test', title: 'nuxt-test', htmlAttrs: { lang: 'en' }, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ] }, // Global CSS: https://go.nuxtjs.dev/config-css css: [ ], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [ ], // Auto import components: https://go.nuxtjs.dev/config-components components: true, // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: [ // https://go.nuxtjs.dev/vuetify '@nuxtjs/vuetify', ], // Modules: https://go.nuxtjs.dev/config-modules modules: [ ], // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { customVariables: ['~/assets/variables.scss'], theme: { dark: true, themes: { dark: { primary: colors.blue.darken2, accent: colors.grey.darken3, secondary: colors.amber.darken3, info: colors.teal.lighten1, warning: colors.amber.base, error: colors.deepOrange.accent4, success: colors.green.accent3 } } } }, // Build Configuration: https://go.nuxtjs.dev/config-build build: { } }

Se agradece mucho cualquier ayuda.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Acabo de encontrar la solución. Resulta que lo que necesito hacer es configurar la propiedad base en el enrutador .

Mi archivo final nuxt.config.js :

 import colors from 'vuetify/es5/util/colors' export default { // Global page headers: https://go.nuxtjs.dev/config-head router:{ base:"/customprefix/" }, static:{ prefix: true }, head: { titleTemplate: '%s - nuxt-test', title: 'nuxt-test', htmlAttrs: { lang: 'en' }, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ] }, // Global CSS: https://go.nuxtjs.dev/config-css css: [ ], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [ ], // Auto import components: https://go.nuxtjs.dev/config-components components: true, // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: [ // https://go.nuxtjs.dev/vuetify '@nuxtjs/vuetify', ], // Modules: https://go.nuxtjs.dev/config-modules modules: [ ], // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { customVariables: ['~/assets/variables.scss'], theme: { dark: true, themes: { dark: { primary: colors.blue.darken2, accent: colors.grey.darken3, secondary: colors.amber.darken3, info: colors.teal.lighten1, warning: colors.amber.base, error: colors.deepOrange.accent4, success: colors.green.accent3 } } } }, // Build Configuration: https://go.nuxtjs.dev/config-build build: { } }

Lo que agrego es:

 router:{ base:"/customprefix/" },
about 4 years ago · Juan Pablo Isaza Report

0

Podrías probar esto

 build: { publicPath: '/your-customprefix/' },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!