Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: remove require transform plugin

Abdullah Attaa54c18e89b31
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 76b0baa03..1e2e60a13 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import { Plugin, PluginOption, defineConfig } from "vite";
+import { PluginOption, defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import svgrPlugin from "vite-plugin-svgr";
import envCompatible from "vite-plugin-env-compatible";
@@ -112,8 +112,6 @@ export default defineConfig({
}) as PluginOption
]
: []),
-
- requireTransformPlugin(),
...(isDesktop && process.env.NODE_ENV === "production"
? []
: [
@@ -140,17 +138,3 @@ export default defineConfig({
})
]
});
-
-function requireTransformPlugin(): Plugin {
- return {
- transform(code, id) {
- if (/\/node_modules\//g.test(id)) return;
- if (!/require/.test(code)) return;
-
- return {
- code: code.replace(/require\(/gm, "await import(")
- };
- },
- name: "require-transform-plugin"
- };
-}