diff --git a/bin/pro-router.imba b/bin/pro-router.imba index a8ab791..71ebe2a 100644 --- a/bin/pro-router.imba +++ b/bin/pro-router.imba @@ -60,7 +60,7 @@ def importRouter return status: true, message: "import definition already there" else try - nfs.writeFileSync indexFile, "import './router.imba'\n" + indexContent + nfs.writeFileSync indexFile, "import './router.imba'\n" + indexContent + "\nR.url_changed() // the best if you move it right before imba.mount" return status: true, message: "definition added successfuly" catch return status: false, message: "failed during writing to file" diff --git a/src/index.js b/src/index.js index 4273cd6..f72e144 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ import './router.imba' -if(import.meta.env.MODE == 'development'){ - import("./main.imba") -} \ No newline at end of file +import './main.imba' +R.url_changed() // the best if you move it right before imba.mount \ No newline at end of file