I have written a Node CLI utility which doesn’t use the browser in any fashion. It reads a BPMN file and generates a couple of text files used for documentation.
When I updated from the older version of the BPMN-Moddle package to the current one, I got some 'exports" errors. I know these are related to the module construction of the BPMN-Moddle package.
Sample of error
\users\jschust2\Dropbox\myDev\CANM2ADOC Development\node_modules\bpmn-moddle\index.js:1
(function (exports, require, module, __filename, __dirname) { export {
^^^^^^
SyntaxError: Unexpected token export
My Node version was a 8.x.x so I updated it to 10.15.x and I’m still getting the same “exports” errors.
If I use Webpack I think I still need to use Babel to compile this into something that will run in Node 10.15.x or the 8.x.x (Some Goverment customers stuck with v8.x.x). Since I’m not using a browser I’m thinking webpack is overkill. I trhink I can use babel directly
My main code is ES6 based and if I transpile backwards using the (env) presets, all that ES6 effort gets undone. I think I need to create a Babel SPECIAL preset that just addresses the module functions used in the latest BPMN-Moddle.
Even after using babel with the ENV presets and testing the Babel generated code I’m getting the same error here.
Maybe I’m headed down the wrong trail completely here and any suggestions are appreciated.