• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

115
Vistas
Path mapping in Javascript?

I'm currently working on a javascript project. I usually use typescript and ts has the path mapping feature. Is there something similar in javascript ?

TS path mapping:

"compilerOptions": {
        "baseUrl": "src",
         ...
        "paths": {
            "@app/*": ["app/*"],
            "@config/*": ["app/_config/*"],
            "@environment/*": ["environments/*"],
            "@shared/*": ["app/_shared/*"],
            "@helpers/*": ["helpers/*"]
        },
        ...
about 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In Webpack this feature is available via resolve.alias. The configuration is similar, for example via webpack.config.js:

const path = require('path');

module.exports = {
  resolve: {
    alias: {
      "@app": path.resolve(__dirname, 'app/'),
      "@config": path.resolve(__dirname, 'app/config/'),
      "@environment": path.resolve(__dirname, 'environments/'),
      // Etc
    },
  },
};
about 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda