Skip to content

Commit

Permalink
re-instated React pre-bundling as some users have reported their bund…
Browse files Browse the repository at this point in the history
…lers cannot handle unbundled 3rd-party modules with ES6 code imports mixed with commonjs. Output file saved in: `./dist/react.tagify.jsx`
  • Loading branch information
yairEO committed Apr 24, 2024
1 parent 2637510 commit 80a2af8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions gulpfile.js
Expand Up @@ -84,11 +84,11 @@ function scss(){

// https://medium.com/recraftrelic/building-a-react-component-as-a-npm-module-18308d4ccde9
function react(done){
// return bundle({
// entry: 'src/react.tagify.jsx',
// outputName: `react.tagify.jsx`,
// })
// .on('end', done)
return bundle({
entry: 'src/react.tagify.jsx',
outputName: `react.tagify.jsx`,
})
.on('end', done)


// return rollupStream({
Expand All @@ -111,9 +111,7 @@ function react(done){

return gulp.src('src/react.tagify.jsx', { sourcemaps: true })
// .pipe($.sourcemaps.init({ loadMaps: true }))
.pipe(
swc(swcOptions)
)
.pipe(swc(swcOptions))
// .pipe(opts.dev ? $.tap(()=>{}) : $.terser())
.pipe($.headerComment(banner))
.pipe($.concat('react.tagify.jsx'))
Expand Down Expand Up @@ -255,11 +253,11 @@ ${LICENSE}`;
function watch(){
gulp.watch('./src/*.scss', scss)
gulp.watch(['./src/tagify.js', './src/parts/*.js'], gulp.series([js]))
// gulp.watch('./src/react.tagify.jsx', react)
gulp.watch('./src/react.tagify.jsx', react)
}


const build = gulp.series(gulp.parallel(js, scss, polyfills), esm) // deprecated the "react" task as i believe it's not needed to consume a pre-bundled version.
const build = gulp.series(gulp.parallel(js, scss, polyfills), esm, react) // deprecated the "react" task as i believe it's not needed to consume a pre-bundled version.

exports.default = gulp.parallel(build, watch)
exports.js = js
Expand Down

0 comments on commit 80a2af8

Please sign in to comment.