How To Use Babel To Fix ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’
When I run the command browserify ./js/test1.js -o build.js in the terminal to bundle some js files into one, it throws the error message like ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’. This article will tell you how to fix it using babel to transcompile the js file source code to ES …