All Questions
Tagged with gulp ecmascript-6
188 questions
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 ...
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 ...
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(&...
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:
// ...
-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....
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 ...
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=&...
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" &&...
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 ...
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 ...
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',
],...
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 ...
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 ...
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 ...
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/...