Answer the question
In order to leave comments, you need to log in
How to include the node_modules Gulp library?
Good afternoon, there was a difficulty, I'm trying to include mapbox in my js file, and I get errors like "Cannot use import statement outside a module",
this is how the connection looks like
import mapboxgl from 'mapbox-gl';
mapboxgl = require('mapbox-gl/dist/mapbox-gl.js')
mapboxgl.accessToken = 'pk.eyJ1IjoiZ3VsYWsxMjMiLCJhIjoiY2wyNDgzbjUyMGluczNncDk1MHlheGNsNiJ9.4nOUSEub8-sL4CUDVdQR-A';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11'
});
Answer the question
In order to leave comments, you need to log in
There is no way in gulp, connect webpack, https://www.npmjs.com/package/webpack-stream
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question