diff --git a/package.json b/package.json index 425d641..33a3bd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@idrinth/react-file-based-routes", - "version": "1.0.0", + "version": "1.0.1", "description": "A simple file based routing library, that does not force itself on you.", "type": "module", "keywords": [ diff --git a/src/jsx-writer.ts b/src/jsx-writer.ts index 87e2642..b6255ba 100644 --- a/src/jsx-writer.ts +++ b/src/jsx-writer.ts @@ -8,16 +8,17 @@ export default class JsxWriter implements Writer { // @ts-ignore TS6133 add(path: string, url: string, changed: string): void { - this.items.push(' ' + `(() => { - const LazyElement = lazy(() => import( - \'./pages/${path}/index.tsx\', - ),); - return { - path: \'${url}\', - exact: true, - element: }>, - }; - })(),`); + this.items.push(` (() => { + const LazyElement = lazy(() => import( + \'./pages/${path}/index.tsx\', + ),); + return { + path: \'${url}\', + exact: true, + element: }>, + }; + })(),` + ); } toString(): string { return 'import React, {\n' + diff --git a/src/tsx-writer.ts b/src/tsx-writer.ts index f78654c..a911402 100644 --- a/src/tsx-writer.ts +++ b/src/tsx-writer.ts @@ -8,16 +8,17 @@ export default class TsxWriter implements Writer { // @ts-ignore TS6133 add(path: string, url: string, changed: string): void { - this.items.push(' ' + `(() => { - const LazyElement = lazy(() => import( - \'./pages/${path}/index.tsx\', - ),); - return { - path: \'${url}\', - exact: true, - element: }>, - }; - })(),`); + this.items.push(` (() => { + const LazyElement = lazy(() => import( + \'./pages/${path}/index.tsx\', + ),); + return { + path: \'${url}\', + exact: true, + element: }>, + }; + })(),`, + ); } toString(): string { return 'import React, {\n' +