You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to install Mapbox on a new rails app generated by Le Wagon template.
First, by default, webpack won't extract CSS anymore. We need to enable it manually:
// config/webpacker.yml
[...]
# Extract and emit a css file
extract_css: true
[...]
Second, i encounter a weird bug on my browser console saying that variable _typeof was not defined. Map was not displayed. Only a grey area. Turns out that webpack was transpiling all node_modules packages through Babel, which causes an issue with mapbox-gl.
To avoid that, we need to add this line: environment.loaders.delete('nodeModules'); to the file config/webpack/environment.js.
It will bypass node_modules packages from the transpiler.
But if we want to bypass only a specific package, another gist of code is available there: rails/webpacker#1903 (comment)
Will do a PR when I have the time next week
The text was updated successfully, but these errors were encountered:
I've been trying to install Mapbox on a new rails app generated by Le Wagon template.
First, by default, webpack won't extract CSS anymore. We need to enable it manually:
Second, i encounter a weird bug on my browser console saying that
variable _typeof was not defined
. Map was not displayed. Only a grey area. Turns out that webpack was transpiling all node_modules packages through Babel, which causes an issue withmapbox-gl
.To avoid that, we need to add this line:
environment.loaders.delete('nodeModules');
to the fileconfig/webpack/environment.js
.It will bypass node_modules packages from the transpiler.
But if we want to bypass only a specific package, another gist of code is available there: rails/webpacker#1903 (comment)
Will do a PR when I have the time next week
The text was updated successfully, but these errors were encountered: