I have this package.json:
{
"name": "theme1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"lodashcustom": "lodash -o ./resources/libs/lodash/lodash.js include=debounce,filter,forEach,template,throttle"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.19.0",
"gulp-babel": "^8.0.0",
"gulp-cachebust": "^0.0.11",
"gulp-clean": "^0.4.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.3",
"gulp-imagemin": "^7.0.1",
"gulp-inline-source": "^4.0.0",
"gulp-rename": "^2.0.0",
"gulp-rtlcss": "^2.0.0",
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2"
},
"dependencies": {
"@popperjs/core": "^2.11.5",
"animate.css": "^4.1.1",
"bootstrap": "^5.3.3",
"glider-js": "^1.7.9",
"gulp": "^5.0.0",
"lodash": "^4.17.21",
"sass": "1.77.6"
}
}
and this is my gulp file:
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var babel = require('gulp-babel');
gulp.task('js', function(){
return gulp.src([
'resources/js/scroller.js',
/* start alterative for resourceslibsbootstrapdistjsbootstrap.bundle.js */
/* popper is needed for BS dropdown.js */
'resources/libs/popperjs/core/dist/umd/popper.js',
/* dom scripts and base-component are included for using BS components when needed */
'resources/libs/bootstrap/dist/js/dom/data.js',
'resources/libs/bootstrap/dist/js/dom/selector-engine.js',
'resources/libs/bootstrap/dist/js/dom/event-handler.js',
'resources/libs/bootstrap/dist/js/dom/manipulator.js',
'resources/libs/bootstrap/dist/js/base-component.js',
/* include a BS component */
'resources/libs/bootstrap/dist/js/dropdown.js',
/* end alternative for bootstrap.bundle.js */
'resources/libs/lodash/lodash.js',
'resources/js/mobilenav.js',
'resources/js/pixieLib.js',
'resources/js/helpers.js',
//'resources/js/animate-lazyload.js',
'resources/js/image-lazyload.js',
'resources/js/site.js'
])
.pipe(concat('main.js'))
.pipe(babel({
'presets' : ['@babel/preset-env']
}))
.pipe(uglify()) // minify
.pipe(gulp.dest('resources/assets/js'));
});
gulp.task('default', gulp.series('js'));
In my browser it returns the error:
main.67f2891f.js:1 Uncaught TypeError: Super expression must either be null or a function
at _inherits (main.67f2891f.js:1:3062)
at main.67f2891f.js:1:34116
at main.67f2891f.js:1:35224
at main.67f2891f.js:1:33818
at main.67f2891f.js:1:33861
It starts bugging me about the BaseCompononent
class of Bootstrap( the link for BaseCompononent on Github).
The function super() is a keyword documented here
Am I missing something here? I have found a list of plugins here: https://babeljs.io/docs/v8-migration
{
"presets" : ["@babel/preset-env"],
"plugins": [
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-private-methods"
]
}