Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
Parcel load typescript package into a html file (CANT IMPORT)

So I have wasted like 6 hours on this.

I need to load a typescript file with a few dependancies into a vanilla js project.

This is what I do.

  1. install all dependancies in the typescript project.
  2. yarn parcel "filepath"
  3. project compiles succesfully into dist folder
  4. move the compiled file (index.js, the only other file is index.js.map) into the vanilla js project.
  5. [The issue] Try to import the parcel file into my vanilla js project. here is what i tried.
import {myFunction} from '/index.js'; //crashes site
import myFunction from '/index.js'; //crashes site
import * from '/index.js'; //symbol not found

import * as things from '/index.js'; 
//console.log(things) prints: Module {Symbol(Symbol.toStringTag): 'Module'} Symbol(Symbol.toStringTag): "Module"

import("./index.js").then(function (myFunction) {
 console.log(myFunction);
});
//prints: Module {Symbol(Symbol.toStringTag): 'Module'} Symbol(Symbol.toStringTag): "Module"

I also have tried export default in the typescript with all the attempts above.

I appreciate any advice.

about 4 years ago · Juan Pablo Isaza
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda