diff --git a/sui/core/script.go b/sui/core/script.go index bc1293e0..3db7c949 100644 --- a/sui/core/script.go +++ b/sui/core/script.go @@ -63,9 +63,11 @@ func LoadScript(file string, disableCache ...bool) (*Script, error) { } } - file = base + ".ts" + file = base + ".backend.ts" + fmt.Println(file) + if exist, _ := application.App.Exists(file); !exist { - file = base + ".js" + file = base + ".backend.js" } if exist, _ := application.App.Exists(file); !exist { diff --git a/sui/storages/local/build.go b/sui/storages/local/build.go index f9800dc9..4a428c2e 100644 --- a/sui/storages/local/build.go +++ b/sui/storages/local/build.go @@ -692,7 +692,7 @@ func (page *Page) writeBackendScript(data map[string]interface{}) error { } ext := filepath.Ext(file) - scriptFile := fmt.Sprintf("%s%s", page.publicFile(data), ext) + scriptFile := fmt.Sprintf("%s.backend%s", page.publicFile(data), ext) scriptFileAbs := filepath.Join(application.App.Root(), scriptFile) dir := filepath.Dir(scriptFileAbs) if exist, _ := os.Stat(dir); exist == nil {