Closed nicolashefti closed 1 year ago
Related to #85.
Swiper is an ES module only, you need to transpile it to work at server-side.
If using Webpack:
// quasar.config.js
module.exports = configure(function (ctx) {
return {
build: {
transpileDependencies: [/swiper/, 'ssr-window', 'dom7'],
}
}
});
If using Vite:
// quasar.config.js
module.exports = configure(function (/* ctx */) {
return {
build: {
extendViteConf(viteConf, { isServer }) {
if (isServer) {
viteConf.ssr = viteConf.ssr || {};
viteConf.ssr.noExternal = viteConf.ssr.noExternal || [];
viteConf.ssr.noExternal.push("swiper");
}
},
},
}
});
Works like a charm. Thanks !
Hi,
I'm using the extension with a Quasar 2 project. I get the following error:
The error message very clear and I am able to patch manually the server-entry.js file, using
import
instead ofrequire
.Manual patch is ok but it has two limitations:
Is there a way to fix this import once for all?