I am using Browserify and would like to use D3.js along with the radar chart component.
import 'd3';
import 'radar-chart-d3';
The radar chart component returns an error Uncaught ReferenceError: d3 is not defined.
I tried using the option insertGlobalVarsfor the browser:
browserify: {
bundleName: 'main.js',
prodSourcemap: false,
insertGlobalVars: {
d3: function(file, dir) {
return 'require("d3")';
}
}
}
However, this does not change anything in the situation. I know that I can simply add require('d3')radar diagrams to the top of the .js file, but I would like to avoid this.
What other way to open a variable d3for a global scope so other files can use d3.
source
share