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

118
Vistas
How to bundle a collection of React components so that they can be imported with a create-react-app app?

I am using create-react-app to create an initial project which needs to import custom React components from a separate node package.

I tried having the React app import a component from the package but this shows an error message stating that it could not transpile scripts from inside node_modules. It seems that it's necessary to pre-process and bundle the JSX syntax.

How can I configure browserify/babel/babelify to bundle the series of components so that the exports are recognised by the app?

import { Panel } from "components-module/react";

The IntelliSense picks up the component imports in VS Code but in the browser console the react app shows an error stating that the react component is undefined and suggests that the module lacks the export statements.

In the Babel configuration I tried setting modules: false under @babel/preset-env to preserve ES6 module syntax in the bundle but this leads to a different error (this time when bundling):

ParseError: 'import' and 'export' may appear only with 'sourceType: module'
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