Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit d1d5d77

Browse files
committed
feat: move to ESM
1 parent b050c90 commit d1d5d77

9 files changed

+14
-15
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ module.exports = {
110110
},
111111
settings: {
112112
jest: {
113-
// we're using vitest which has a very similar API to jest
114-
// (so the linting plugins work nicely), but it means we have to explicitly
115-
// set the jest version.
113+
// We're using vitest which has a very similar API to jest
114+
// (so the linting plugins work nicely), but it means we
115+
// have to set the jest version explicitly.
116116
version: 28,
117117
},
118118
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ This project uses TypeScript. It's recommended to get TypeScript set up for your
213213

214214
### Linting
215215

216-
This project uses ESLint for linting. That is configured in `.eslintrc.js`.
216+
This project uses ESLint for linting. That is configured in `.eslintrc.cjs`.
217217

218218
### Formatting
219219

File renamed without changes.

mocks/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { http, passthrough } = require("msw");
2-
const { setupServer } = require("msw/node");
1+
import { http, passthrough } from "msw";
2+
import { setupServer } from "msw/node";
33

44
// put one-off handlers that don't really need an entire file to themselves here
55
const miscHandlers = [

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
"name": "blues-stack-template",
33
"private": true,
44
"sideEffects": false,
5+
"type": "module",
56
"scripts": {
67
"build": "npm-run-all --sequential build:*",
78
"build:remix": "remix build",
8-
"build:server": "esbuild --platform=node --format=cjs ./server.ts --outdir=build --bundle --external:fsevents",
9+
"build:server": "esbuild --platform=node --format=esm ./server.ts --outdir=build --bundle --external:fsevents",
910
"dev": "npm-run-all --parallel dev:*",
1011
"dev:server": "cross-env NODE_ENV=development npm run build:server -- --watch",
11-
"dev:remix": "remix dev --manual -c \"node --require ./mocks --watch-path ./build/server.js --watch ./build/server.js\"",
12+
"dev:remix": "remix dev --manual -c \"node --import ./mocks/index.js --watch-path ./build/server.js --watch ./build/server.js\"",
1213
"docker": "docker compose up -d",
1314
"format": "prettier --write .",
1415
"format:repo": "npm run format && npm run lint -- --fix",
1516
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
1617
"setup": "prisma generate && prisma migrate deploy && prisma db seed",
1718
"start": "cross-env NODE_ENV=production node ./build/server.js",
18-
"start:mocks": "cross-env NODE_ENV=production node --require ./mocks --require dotenv/config ./build/server.js",
19+
"start:mocks": "cross-env NODE_ENV=production node --import ./mocks/index.js --require dotenv/config ./build/server.js",
1920
"test": "vitest",
2021
"test:e2e:dev": "start-server-and-test dev http://localhost:3000 \"npx cypress open\"",
2122
"pretest:e2e:run": "npm run build",

postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},

prettier.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/** @type {import("prettier").Config} */
2-
module.exports = {
2+
export default {
33
plugins: ["prettier-plugin-tailwindcss"],
44
};

remix.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @type {import('@remix-run/dev').AppConfig} */
2-
module.exports = {
2+
export default {
33
cacheDirectory: "./node_modules/.cache/remix",
44
ignoredRouteFiles: ["**/.*", "**/*.test.{ts,tsx}"],
5-
serverModuleFormat: "cjs",
65
};

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"isolatedModules": true,
88
"esModuleInterop": true,
99
"jsx": "react-jsx",
10-
"module": "CommonJS",
11-
"moduleResolution": "node",
10+
"moduleResolution": "Bundler",
1211
"resolveJsonModule": true,
1312
"target": "ES2020",
1413
"strict": true,

0 commit comments

Comments
 (0)