I'm looking for a clear way to either require
const MyModel = require("../../models/MyModel");
or import
import MyModel from "../../models/MyModel";
local modules in a way that Quokka understands in ES6. Both approaches compile and do not throw errors on runtime. However, Quokka either says the require code has an "Unexpected Identifier
" or ignores the import code line entirely.
Quokka supports module imports only for pro version. If you are ready to go, there might be additional configuration needed. You can configure inside the
package.json
file, the settings below:Also you are able to set it as global on
~/.quokka/config.json