feat: Clear modules before loading shared library

Clear the modules before loading the shared library to ensure a clean state. This is necessary to avoid any conflicts or issues with previously loaded modules.
This commit is contained in:
Max 2024-06-06 15:44:28 +08:00
parent 55ca180f7f
commit 26189fd61f

View file

@ -11,6 +11,7 @@ import (
// Load 加载共享库
func Load(cfg config.Config) error {
v8.CLearModules()
exts := []string{"*.js", "*.ts"}
err := application.App.Walk("scripts", func(root, file string, isdir bool) error {
if isdir {