Skip to content

Commit 4a1f76f

Browse files
committed
publish 1.2.8
1 parent 977fb03 commit 4a1f76f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@idrinth/react-file-based-routes",
3-
"version": "1.2.7",
3+
"version": "1.2.8",
44
"repository": "https://github.com/idrinth/react-file-based-routes",
55
"description": "A simple file based routing library, that does not force itself on you.",
66
"license": "MIT",

src/generate-folders.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ export default (cwd: string, configuration: Configuration) => {
5252
const name = createHash('sha256')
5353
.update(JSON.stringify(jsFiles) + JSON.stringify(cssFiles))
5454
.digest('hex');
55-
const tag = `<script type="text/javascript">setTimeout(() => {const d=document;const s=d.createElement('script');s.setAttribute('type','application/javascript');s.setAttribute('src', '/${configuration.fileFinder.distJSRoot}/irfbr-${name}.js');d.getElementsByTagName('header')[0].appendChild(s)), ${ configuration.fileBuilder.preloadStartDelay })</script>`;
55+
const loader = minify(`setTimeout(() => {
56+
const d = document;
57+
const s = d.createElement('script');
58+
const a = (t, v) => s.setAttribute(t, v);
59+
a('type', 'application/javascript');
60+
a('src', '/${configuration.fileFinder.distJSRoot}/irfbr-${name}.js');
61+
d.getElementsByTagName('header')[0].appendChild(s);
62+
} , ${ configuration.fileBuilder.preloadStartDelay });`);
63+
const tag = `<script type="text/javascript">${ loader }</script>`;
5664
if (jsFiles.length > 0 && cssFiles.length > 0) {
5765
const script = `(() => {
5866
${ func }

0 commit comments

Comments
 (0)