Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

532
Visualizações
ReactJS include or import custom or external javascript file

I have a very basic question regarding ReactJS and pretty much between being beginner and intermediate.

I have designed my web application UI in webflow and now developing the frontend application in ReactJS.

So, now I have two JS files called mordenizr.js and webflow.js which I have to import in to my ReactJS component and pages JSX files. I wanted to know How could I import external or custom JavaScript files like these in to ReactJS and they are in plain/obfuscated/minified JS and not in ES6 format.

PS: I have created the project using create-react-app so not able to change or see webpack & babel configuration too

Thank you.

Regards,

Rohit

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I don't see why import 'path/to/mordenizr' and import 'path/to/webflow' wouldn't just work.

After all, javascript files (even "plain/obfuscated/minified" ones) are valid ES6, so webpack should be able to import them like normal.

over 4 years ago · Santiago Trujillo Relatório

0

It does not matter whether these files are ES6 format or not, import 'mordenizr' should work in either case. The reason for this is that when Webpack transpiles your ES6 files, imports will get back to require format.

over 4 years ago · Santiago Trujillo Relatório

0

use ["babel-plugin-import": "^1.0.1"] https://github.com/ant-design/babel-plugin-import for webpack

example:

plugins: ['transform-runtime','transform-decorators-legacy',['import', {
      libraryName: 'antd',
      style: 'css',
    }]]
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda