Próbuję użyć polyfilla do IntersectionObserver (https://github.com/w3c/IntersectionObserver/tree/master/polyfill).
Muszę go dociągać za pomocą require('intersection-observer).
Po odpaleniu strony pokazuje się komunikat require is not defined.
Config buildera:
module.exports = () => {
return rollup({
format: 'iife',
input: '../resources/assets/js/app.js',
plugins: [
resolve({
jsnext: true,
preferBuiltins: true,
browser: true
}),
json(),
commonjs(),
babel()
]
})
.on('error', message.error('JAVASCRIPT: Bundling'))
.pipe(source('app.js'))
.pipe(buffer())
.pipe(gulpif(!isdev, uglify()))
.on('error', message.error('JAVASCRIPT: Minification'))
.pipe(gulp.dest('../public/js'))
}
PS. W tym pliku mogę używać require, ale problem dotyczy plików w app.js