Find Jobs
Hire Freelancers

use Requirejs or a similar tool to build a single-file JS code by linking a module made of multiple JS files

$10-30 USD

Færdiggjort
Slået op cirka 6 år siden

$10-30 USD

Betales ved levering
I wrote a code [login to view URL] that loads and uses a third party module: const foo = require('foo'); ... var x = [login to view URL](data); I installed the module foo with npm install. I can run [login to view URL] from terminal and it works. Now I want to build a single JS file that I could use in a browser. The problem is that the module foo is not just a code named [login to view URL], but a folder ./node_modules/foo/dist/ with 3 JS files in it: [login to view URL], [login to view URL], c.js. I used Requirejs and I managed to build a sample bundle out of [login to view URL] and some other module bar but only when it consists of a single file bar.js. When I'm trying to do the same with foo, I'm getting the error Tracing dependencies for: main Error: ENOENT: no such file or directory, open '/home/greg/blabla/node_modules/[login to view URL]' Indeed foo is not a file but a directory that contains the code files. How do I get around this issue and load a module made of multiple JS scrips by referring to the module name and not to the individual JS file name(s)? Please bid if you know how. This should be a 5-10 min job for an expert. I also tried Browserify. It creates a single bundle JS file without complaints and I can see that this file actually includes the codes from all 3 of the module's JS files, but the bundled JS code fails to work in a browser because it still contains a require() call in it...
Projekt-ID: 16367004

Om projektet

2 forslag
Projekt på afstand
Aktiv 6 år siden

Leder du efter muligheder for at tjene penge?

Fordele ved budafgivning på Freelancer

Fastsæt dit budget og din tidsramme
Bliv betalt for dit arbejde
Oprids dit forslag
Det er gratis at skrive sig op og byde på jobs
Tildel til:
Brug Avatar.
hi. send me files and instructions how to reproduce the error. i will try to solve it .
$30 USD på 1 dag
5,0 (9 anmeldelser)
4,3
4,3
2 freelancere byder i gennemsnit $30 USD på dette job
Brug Avatar.
Hello, I would love to work with you. I m a professional web developer and designer. I have good knowledge of javascript and function. I would be a great help to you. more details I can explain in chat. looking forward for a response thank you
$30 USD på 1 dag
0,0 (0 anmeldelser)
0,0
0,0

Om klienten

Flag for UNITED STATES
Champaign, United States
5,0
16
Betalingsmetode verificeret
Medlem siden nov. 21, 2014

Klientverificering

Tak! Vi har sendt dig en e-mail med et link, så du kan modtage din kredit.
Noget gik galt, da vi forsøgte at sende din mail. Prøv venligst igen.
Registrerede brugere Oprettede jobs i alt
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Indlæser forhåndsvisning
Geolokalisering er tilladt.
Din session er udløbet, og du er blevet logget ud. Log venligst ind igen.