Skip to content

Commit 057c610

Browse files
committed
publish 1.2.1
fix regex
1 parent 150d927 commit 057c610

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.0",
3+
"version": "1.2.1",
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export default (cwd: string, configuration: Configuration) => {
1414
}
1515
return data;
1616
})();
17-
const matcher = new RegExp(`${configuration.fileFinder.distJSRoot}/(.*?)${configuration.fileFinder.fileName}`);
17+
const matcher = new RegExp(`="${cwd}/${configuration.fileFinder.pagesRoot}/([^"]*?)${configuration.fileFinder.fileName}"`, 'u');
1818
const fileName = configuration.fileFinder.fileName.replace(/\.tsx$/, '-');
1919
const cssFiles = [];
2020
const jsFiles = [];
2121
const files = readdirSync(cwd + '/' + configuration.fileFinder.distJSRoot, {encoding: 'utf8', recursive: true});
2222
if (configuration.fileBuilder.preLoadCSS) {
2323
for (const file of files) {
24-
if (file.endsWith('.css',)) {
24+
if (file.endsWith('.css',) && ! file.startsWith('index-',)) {
2525
cssFiles.push(file,);
2626
}
2727
}
@@ -33,7 +33,6 @@ export default (cwd: string, configuration: Configuration) => {
3333
}
3434
}
3535
}
36-
3736
for (const file of files) {
3837
if (file.endsWith('.js') && file.startsWith(fileName)) {
3938
const content = readFileSync(cwd + '/' + configuration.fileFinder.distJSRoot + '/' + file, 'utf8',);

0 commit comments

Comments
 (0)