This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG TAG_NODE_BUILDER=latest | |
FROM my-private-cr/node-builder:$TAG_NODE_BUILDER | |
COPY packge.json . | |
RUN npm i --production | |
ARG TAG_NODE_RUNNER=latest | |
FROM my-private-cr/node-runner:$TAG_NODE_RUNNER | |
COPY --from=0 /app / | |
COPY . /app/ | |
RUN apk update --no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:lts | |
WORKDIR /app | |
COPY . . | |
RUN npm i | |
EXPOSE 3000/tcp | |
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as requireYaml from "require-yml"; | |
import * as set from "lodash.set"; | |
import * as merge from "deepmerge"; | |
import { load as parseYaml } from "js-yaml"; | |
import { readFileSync } from "fs"; | |
type StringMap = { [key: string]: string }; | |
let config: any, configRootPath: string; | |
_resetConfig(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this gist is an appendix for the discussion in this article: | |
# https://medium.com/@osherel/yet-another-look-on-js-require-and-import-e2a6316a161d | |
#Some setup: | |
mkdir -p sandbox/packages/a sandbox/packages/c; | |
cd sandbox; | |
echo '{"name":"sandbox","version":"1.0.0","workspaces":["packages/*"]}' > package.json; | |
npm init -y -w -q packages/a; | |
npm init -y -w -q packages/c; | |
echo 'export default "a"' > packages/a/index.js; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
CJS=0; ESM=0; DUAL=0; UN=0; UNP=''; TYPES=0; | |
# for each `package.json` in the `node_modules` first and second levels: | |
for P in $({ | |
ls node_modules/*/package.json; | |
ls node_modules/*/*/package.json || true; | |
ls node_modules/**/node_modules/*/package.json || true; | |
ls node_modules/**/node_modules/*/*/package.json || true; | |
} | sort); do | |
echo "checking: $P"; |
OlderNewer