Skip to main content

All Questions

Tagged with
0 votes
0 answers
51 views

Problem with gulpfile.babel.json and ReferenceError: require is not defined

I'm facing a weird problem with my build, my browser says: Uncaught ReferenceError: require is not defined at app.js?ver=1.0.0:3:15 The problem is: I'm not using require in my dev js file, I'm ...
Rafhael Marsigli's user avatar
0 votes
0 answers
513 views

Do I need Babel to transpile ES6 to ES5 nowadays?

I'm trying to upgrade an angularJS project and I'm stucked on one question, but let me summerize the project: We use AngularJS, gulp and node 8. we currently cannot use the ES6 features, like arrow ...
bbynog's user avatar
  • 1
2 votes
1 answer
299 views

How to integrate es6 with gulp-develop-server

I am trying to transfer an old node-express project over to be able to use es6. I have seen many posts about using gulp with es6. Most of them discuss using a syntax like this: const gulp = require(&...
Seth Lutske's user avatar
  • 10.6k
19 votes
6 answers
28k views

Getting ` Error [ERR_REQUIRE_ESM]` while running `gulp` command

I'm new to Gulp and trying to automate some tasks. Here's my environment setup: npm version: 8.1.0, node version 17.0.1, gulp CLI version 2.3.0 and gulp version 4.0.2 And here's my gulpfile.js: // ...
Bipul Roy's user avatar
  • 566
-2 votes
1 answer
544 views

How to use global object window or document in javascript es6 Class [closed]

How can I use the window or document inside a JavaScript ES6 class I tried the following code Scenario #1: class App { constructor() { console.info('App Initialized'); document....
B.Balamanigandan's user avatar
0 votes
0 answers
259 views

Enable ES6 syntax in an AngularJS project

I've a big Angular project with gulp and other tools configured (I don't know these tools), this project seems not to support ES6 syntax (.map/.filter/destructuring/etc.) even if the Node version I'm ...
pinale's user avatar
  • 2,214
1 vote
1 answer
281 views

twgl.js trouble loading texture using es6 modules

I'm trying to load a texture into a 2d plane like demonstrated on this post How to draw 2D image with TWGL (WebGL helper Library). It works fine when including the script tag like so <script src=&...
The Sloth's user avatar
  • 387
3 votes
1 answer
731 views

Why does Babel add this duplicate line of code to my build?

I'm using Babel 7 and Gulp 4 together, and found that the following line of code appears 5 times in my build: function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" &&...
asw1984's user avatar
  • 763
2 votes
0 answers
381 views

How do I add select polyfills using Babel 7 and Gulp?

I recently upgraded to Babel 7 using Gulp 4. After deploying my code, I realized there are IE 11 compatibility issues, and also issues with early versions of Microsoft Edge browser (16, 17, 18) where ...
asw1984's user avatar
  • 763
3 votes
1 answer
5k views

Browserify --standalone with ES6 modules and multiple source files and exports

I am trying to use Gulp, Browserify, and Babelify to compile and transform multiple ES6 files into a single JavaScript library that can be shared with other developers. I am trying to use multiple ...
Katie Kilian's user avatar
  • 6,965
0 votes
0 answers
50 views

Gulp4 problem with output file main.min.js after concat

I have problem with my output file main.min.js in Gulp4. I think it's a problem with concatenation My path files: const config = { app: { js: [ './src/js/**/*.js', ],...
handzel's user avatar
  • 91
4 votes
0 answers
369 views

Using Gulp 4 with ES6 - Issue with Babel

I want to be able to have a global Gulp configuration with ES6 syntax. I've been migrating to Gulp 4 and found good opportunity to use ES6 syntax. However I use a one single Gulp configuration for ...
João Augusto's user avatar
2 votes
2 answers
6k views

How to fix "cannot find module 'gulp-babel'"?

I was learning JS by the book "Learning JavaScript. 3rd Edition" And when it came to transpilers and I did everything exactly like in the book, I still got an error when I type gulp in Bash. Is there ...
Not_a_fast_learner's user avatar
0 votes
0 answers
215 views

how to minify typescript file to javascript , am using Nodejs 6 [duplicate]

I am writing the typescript code and want to convert into .min.js file, After the conversion is getting exports and require an undefined exception. if I will use the latest gulp commands am getting ...
user2471037's user avatar
0 votes
1 answer
275 views

ES6 import multiple files

I'm migrating from gulp (using bower) to webpack. Within bower.json I had used this setup to include Waypoints. "waypoints": { "main": [ "lib/jquery.waypoints.min.js", "lib/shortcuts/...
John the Painter's user avatar

15 30 50 per page
1
2 3 4 5
13