diff --git a/app-webpack/lib/modes/electron/electron-builder.js b/app-webpack/lib/modes/electron/electron-builder.js index 0352fa6bcc2..653330ff214 100644 --- a/app-webpack/lib/modes/electron/electron-builder.js +++ b/app-webpack/lib/modes/electron/electron-builder.js @@ -50,7 +50,7 @@ module.exports.QuasarModeBuilder = class QuasarModeBuilder extends AppBuilder { delete pkg.browserslist delete pkg.scripts - pkg.main = './electron-main.mjs' + pkg.main = './electron-main.js' if (typeof this.quasarConf.electron.extendPackageJson === 'function') { this.quasarConf.electron.extendPackageJson(pkg) diff --git a/app-webpack/lib/modes/electron/electron-config.js b/app-webpack/lib/modes/electron/electron-config.js index fc15221e7a0..1c47114c179 100644 --- a/app-webpack/lib/modes/electron/electron-config.js +++ b/app-webpack/lib/modes/electron/electron-config.js @@ -63,8 +63,8 @@ const quasarElectronConfig = { cfg.entryPoints = [ quasarConf.sourceFiles.electronMain ] cfg.outfile = quasarConf.ctx.dev === true - ? appPaths.resolve.entry('electron-main.mjs') - : join(quasarConf.build.distDir, 'UnPackaged/electron-main.mjs') + ? appPaths.resolve.entry('electron-main.js') + : join(quasarConf.build.distDir, 'UnPackaged/electron-main.js') cfg.define = { ...cfg.define, diff --git a/app-webpack/lib/modes/electron/electron-devserver.js b/app-webpack/lib/modes/electron/electron-devserver.js index 3b5e59e8f0e..fbe675f2fce 100644 --- a/app-webpack/lib/modes/electron/electron-devserver.js +++ b/app-webpack/lib/modes/electron/electron-devserver.js @@ -134,7 +134,7 @@ module.exports.QuasarModeDevserver = class QuasarModeDevserver extends AppDevser this.#electronExecutable, [ '--inspect=' + quasarConf.electron.inspectPort, - this.ctx.appPaths.resolve.entry('electron-main.mjs') + this.ctx.appPaths.resolve.entry('electron-main.js') ].concat(this.argv._), { cwd: this.ctx.appPaths.appDir }, code => { diff --git a/app-webpack/lib/modes/ssr/ssr-config.js b/app-webpack/lib/modes/ssr/ssr-config.js index 413333acc9a..4a0a89a3b4b 100644 --- a/app-webpack/lib/modes/ssr/ssr-config.js +++ b/app-webpack/lib/modes/ssr/ssr-config.js @@ -8,7 +8,6 @@ const { createNodeEsbuildConfig, extendEsbuildConfig } = require('../../config-tools.js') -const { cliPkg } = require('../../utils/cli-runtime.js') const { getBuildSystemDefine } = require('../../utils/env.js') const { injectWebpackHtml } = require('../../utils/html-template.js') @@ -171,7 +170,7 @@ const quasarSsrConfig = { if (ctx.dev) { cfg.entryPoints = [ appPaths.resolve.entry('ssr-dev-webserver.js') ] - cfg.outfile = appPaths.resolve.entry('compiled-dev-webserver.js') + cfg.outfile = appPaths.resolve.entry('compiled-dev-webserver.cjs') } else { cfg.external = [ diff --git a/app-webpack/lib/modes/ssr/ssr-devserver.js b/app-webpack/lib/modes/ssr/ssr-devserver.js index 62cfc2663d1..a1eb329011e 100644 --- a/app-webpack/lib/modes/ssr/ssr-devserver.js +++ b/app-webpack/lib/modes/ssr/ssr-devserver.js @@ -96,7 +96,7 @@ module.exports.QuasarModeDevserver = class QuasarModeDevserver extends AppDevser this.#pathMap = { rootFolder: appPaths.appDir, publicFolder, - serverFile: appPaths.resolve.entry('compiled-dev-webserver.js'), + serverFile: appPaths.resolve.entry('compiled-dev-webserver.cjs'), serverEntryFile: appPaths.resolve.entry('server-entry.js'), resolvePublicFolder () { return join(publicFolder, ...arguments) diff --git a/app-webpack/lib/utils/inject-style-rules.js b/app-webpack/lib/utils/inject-style-rules.js index ca064f66707..3f7f2dc6d7d 100644 --- a/app-webpack/lib/utils/inject-style-rules.js +++ b/app-webpack/lib/utils/inject-style-rules.js @@ -30,153 +30,156 @@ function shouldRequireUrl (url) { ) === false } -function injectRule (chain, pref, lang, test, loader, loaderOptions) { - const baseRule = chain.module.rule(lang).test(test) +async function createRule ({ rule, isModules, pref, loader, loaderOptions }) { + if (pref.isServerBuild === true) { + rule.use('null-loader') + .loader('null-loader') + return + } - // rules for