I want to host a web app on Google Firebase hosting, and import
code from node modules, but I can't find the right way to go about this.
I have installed the modules on my dev machine into the main directory of the Firebase install, and imported them from my own JS file, but any way I try, I get error messages. For example (ol
stands for OpenLayers):
import '../ol/ol.css';
import {Map, View} from '../ol';
import TileLayer from '../ol/layer/Tile';
import OSM from '../ol/source/OSM';
I then get these errors:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/css".
The MIME type in that error message is sometimes also "text/html"
.
Are there more steps than just placing package.json
and node_modules
in the right place?
I've tried tinkering around but am probably missing something obvious...