1
votes

I am trying to use the mapbox csp feature. The documentation shows there's a CDN bundle for the CSP distribution. I'm wondering how I could use the CSP distribution with npm. From the node_module, it looks like mapbox-gl-csp.js is included in the mapbox module. mapbox module dist folder

However, I'm having a hard time understanding how I can switch to the csp distribution rather than the regular mapbox-gl.js in npm. I've tried to add a path in my tsconfig.json, but it doesn't seem to be working and still using the regular mapbox-gl.js:

"compilerOptions": {
    ...
    "paths": {
        "mapbox-gl": ["./node_modules/mapbox-gl/dist/mapbox-gl-csp.js"]
    }
}

I'm wondering what I should do to make my project use the mapbox csp bundle with npm?

1

1 Answers

0
votes

You should be able to do something like:

import MapboxGl from 'mapbox-gl/dist/mapbox-gl-csp;