diff --git a/readme.md b/readme.md index 66a06f1..9b0728d 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,3 @@ # pro-router-imba2 -Integration of pro-router and Imba2. More information here http://imba-router.maniak.pro. \ No newline at end of file +Integration of pro-router and Imba2. More information here https://router.maniak.pro/imba2. \ No newline at end of file diff --git a/site/src/main.imba b/site/src/main.imba index b9cd1e0..944cba4 100644 --- a/site/src/main.imba +++ b/site/src/main.imba @@ -120,4 +120,4 @@ import './views/installation.imba' import './views/usage.imba' import './views/choosing-router-style.imba' -imba.mount if import.meta.env.MODE is 'development' \ No newline at end of file +imba.mount \ No newline at end of file diff --git a/src/vite-plugin.js b/src/vite-plugin.js index 3f58941..dea832d 100644 --- a/src/vite-plugin.js +++ b/src/vite-plugin.js @@ -9,16 +9,19 @@ let pathViews = {} // path: [view] function duplicate(obj){ return JSON.parse(JSON.stringify(obj)) } function without(el, arr) { return arr.filter(function(e){ if(e != el) { return e } }) } +let config module.exports = function proRouterViews() { return { name: 'pro-router-views', - transformIndexHtml(html) { - return html.replace('', '') + + configResolved(resolvedConfig) { + config = resolvedConfig }, transform: { order: 'pre', handler(src, id) { + if (config.command !== 'serve'){ return src } if (/\.imba$/.test(id)) { let modified = false let viewRegExp = /tag view-((\w|\S)+)( |\n)/g