Skip to content

Commit

Permalink
fix(imports): use JS file
Browse files Browse the repository at this point in the history
  • Loading branch information
obviyus committed Jul 22, 2022
1 parent 1e904b1 commit 68d443d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/routes/image/$name.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LoaderFunction } from "@remix-run/cloudflare";
import { redirect } from "@remix-run/cloudflare";
import images from '../../../images/index';
import images from '~/images';
import { useLoaderData } from "@remix-run/react";

export const loader: LoaderFunction = async ({ params, }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import images from '../../images/index';
import images from '~/images';
import Masonry from 'react-masonry-css'
import { Link } from "@remix-run/react";

Expand Down
4 changes: 2 additions & 2 deletions importer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export default async function imageImporter() {
/**
* Write all imports to the index.js file
*/
fs.writeFileSync('public/index.js', importStatementBuilder(image_names));
fs.appendFileSync('public/index.js', imageExportListBuilder(image_names));
fs.writeFileSync('./app/images.ts', importStatementBuilder(image_names));
fs.appendFileSync('./app/images.ts', imageExportListBuilder(image_names));
}

await imageImporter();

0 comments on commit 68d443d

Please sign in to comment.