Webpack 4 importing of json
snoop244 opened this issue · 2 comments
snoop244 commented
I'm truly out of my depth here, but I could not pull camunda moddle into my code directly because Webpack 4 seems to wrap such objects in an additional layer.
See the details of my issue here (with my hack fix):
https://forum.camunda.org/t/error-package-with-prefix-undefined-already-defined/8126/2
nikku commented
Quoting from the blog post you linked:
import * as camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
import * as korioBPMNModdleDescriptor from './KorioBPMNModdleDescriptor.json'
import * as ...
is almost always the wrong way to consume files. It breaks all good things that come with ES 6, such as tree shaking, too.
Does the following work / yield a different result?
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda';
...
snoop244 commented
Thank you nikku - yes, that did work.