I’m developing a panel plugin and using webpack to build. I’m curious if the librayTarget has to be set as amd, or it may not be required to set.
I’m trying to use a third party libray, once the libraryTarget is set I will get error:
Uncaught ReferenceError: define is not defined
In this package the core modules of nodejs such as fs, path and crypto are used.
We’re switching our plugins to use @grafana/toolkit to make this easier to do. With external (extra) libraries though we’ll be adding a path that gets copied vs “webpacked.” Tree shaking seems to be having side effects on some libraries.
Sorry, I don’t have a repo. After I updated webpack from 3.0+ to 4.0 the problems are gone.
And the third party library is a commonjs module but I still can import it by ‘import * from ‘package name’…’
If I understand correctly you use external libraries in your plugin? How did you do for transpilation? did you change the webpack config? If so, do you have an example?