Skip to content

Commit 3644184

Browse files
committed
[Svelte]: fix main.js \
1 parent 5eaf3ea commit 3644184

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

svelte.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ func (gs *GoSvelt) compileSvelteFile(inFile, outFile, rootDir string, tailwind b
203203
if rootDir != "" {
204204
// if typescript
205205
if exist(svelteEnv + "/src/main.ts") {
206-
err = ioutil.WriteFile(svelteEnv+"/src/main.ts", []byte("import App from './"+filepath.Join(filepath.Dir(oldFile), svelteApp)+"'; export default new App({ target: document.body });"), 0644)
206+
err = ioutil.WriteFile(svelteEnv+"/src/main.ts", []byte("import App from './"+strings.ReplaceAll(filepath.Join(filepath.Dir(oldFile), svelteApp), `\`, "/")+"'; export default new App({ target: document.body });"), 0644)
207207
if err != nil {
208208
return errCustomMaints
209209
}
210210

211211
} else {
212-
err = ioutil.WriteFile(svelteEnv+"/src/main.js", []byte("import App from './"+filepath.Join(filepath.Dir(oldFile), svelteApp)+"'; export default new App({ target: document.body });"), 0644)
212+
err = ioutil.WriteFile(svelteEnv+"/src/main.js", []byte("import App from './"+strings.ReplaceAll(filepath.Join(filepath.Dir(oldFile), svelteApp), `\`, "/")+"'; export default new App({ target: document.body });"), 0644)
213213
if err != nil {
214214
return errCustomMaints
215215
}

0 commit comments

Comments
 (0)