deepak1556 / gulp-browserify

Bundle modules with BrowserifyJS
MIT License
195 stars 45 forks source link

ParseError: 'import' and 'export' may only appear at the top level #99

Open Yuriy-Svetlov opened 6 years ago

Yuriy-Svetlov commented 6 years ago

Hi! I get error.

ParseError: 'import' and 'export' may only appear at the top level

gulpfile.js

gulp.task("default", function () {
  return gulp.src("src/test1/*.js") 
    .pipe(watch('src/test1/*.js'))
    .pipe(plumber())   
        .pipe(babel({
                    presets: ['@babel/env', '@babel/preset-react']
         }))  
        .pipe(browserify({
                   insertGlobals : true,
                  debug : !gulp.env.production,
                  transform:['browserify-postcss', 'babelify']
        }))     
    .pipe(gulp.dest("buld"));
});