Implement slightly hacky plugin to convert CJS to AMD modules

This commit is contained in:
koloml committed 2026-10-17 04:51:33 +02:00
1 parent 5435e055c3
commit 9c5ef143e7
2 files changed
+172

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ import path from "path";
import fs from "fs";
import { SwapDefinedVariablesPlugin } from "../plugins/swap-defined-variables.js";
import { ScssViteReadEnvVariableFunctionPlugin } from "../plugins/scss-read-env-variable-function.js";
import { ConvertCjsToAmd } from "../plugins/convert-cjs-to-amd.js";
/**
* Create the result base file name for the file.
@@ -208,6 +209,7 @@ export async function buildScriptsAndStyles(buildOptions) {
alias: aliasesSettings,
},
plugins: [
ConvertCjsToAmd(),
wrapScriptIntoIIFE(),
collectDependenciesForManifestBuilding((fileName, dependencies) => {
pathsReplacementByOutputPath