I’m getting this error:
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0) while parsing [folder]\node_modules\bpmn-js\lib\Modeler.js
when running npm run build with Browserify in Node.js command prompt
here is my package.json:
{
"name": "bpmnpoc",
"version": "1.0.0",
"description": "POC of bpmn js",
"main": "bpmn-poc.js",
"scripts": {
"build": "browserify bpmn-poc.js -o bpmn-poc-bundle.js",
"watch": "watchify bpmn-poc.js -o bpmn-poc-bundle.js"
},
"author": "Bruce",
"license": "ISC",
"devDependencies": {
"browserify": "^16.2.2"
},
"dependencies": {
"bpmn-js": "^2.4.1",
"watchify": "^3.11.0"
}
}
This is my first time using above technologies so apologies if I missed something. I searched around and the solution is to somehow make Modeler.js run as ES 5? Would it work then if I convert Modeler.js alone into ES 5 or do I need to use another transpiler like Babel and convert all js scripts in my library to run ES 5? Thanks in advance!
Regards,
Bruce