Skip to content

Commit

Permalink
Use --es-module-specifier-resolution=node
Browse files Browse the repository at this point in the history
Maybe this will help my esm imports?

Notes:
- SO Discussion: https://stackoverflow.com/a/65588027
- GH Discussion: nodejs/node#27408 (comment)
  • Loading branch information
joshuanianji committed Mar 15, 2023
1 parent 2dcaf0a commit 789dc3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .devcontainer/editor.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ FROM mcr.microsoft.com/devcontainers/javascript-node:0-16-bullseye
# required for chartjs-node-canvas on arm machines
# https://github.com/SeanSobey/ChartjsNodeCanvas/issues/107#issuecomment-1185438310
# https://github.com/Automattic/node-canvas/wiki/Installation%3A-Ubuntu-and-other-Debian-based-systems
# Since I am deploying this project to my Digital ocean droplet (x86), I don't need to install these in the actual dockerfile
RUN sudo apt-get update && \
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ COPY . .
# but as a note, prisma is included in the "production" dependencies
# https://www.prisma.io/docs/guides/deployment/deploy-database-changes-with-prisma-migrate
RUN npm run build && npm prune --production
CMD [ "/usr/bin/dumb-init", "--", "node", "build/index.js" ]
CMD [ "/usr/bin/dumb-init", "--", "node", "--es-module-specifier-resolution=node", "build/index.js" ]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "tsx watch ./src/index.ts",
"build": "tsc",
"postinstall": "prisma generate"
"postinstall": "prisma generate",
"start": "node --es-module-specifier-resolution=node build/index.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 789dc3c

Please sign in to comment.