1
0
Fork 0

fix(build): split index into its own chunk

This commit is contained in:
ssube 2019-06-29 19:36:41 -05:00
parent 96d15bb480
commit 8351fff973
5 changed files with 12 additions and 7 deletions

View File

@ -6,8 +6,9 @@ COPY docs/config-docker.yml /root/.salty-dog.yml
# copy package first, to invalidate other layers when version changes
COPY package.json /salty-dog/package.json
COPY out/vendor.js /salty-dog/out/vendor.js
COPY out/index.js /salty-dog/out/index.js
COPY out/main.js /salty-dog/out/main.js
COPY rules /salty-dog/rules
ENTRYPOINT [ "node", "/salty-dog/out/main.js" ]
ENTRYPOINT [ "node", "/salty-dog/out/index.js" ]

View File

@ -121,7 +121,7 @@ run-rules: ## validate the rules directory
find $(ROOT_PATH)/rules -maxdepth 1 -name '*.yml' | while read file; \
do \
echo "Validating $${file}..."; \
node out/main.js \
node out/index.js \
--config-path $(ROOT_PATH)/docs \
--config-name config-stderr.yml \
--rules $(ROOT_PATH)/rules/salty-dog.yml \
@ -130,7 +130,7 @@ run-rules: ## validate the rules directory
done
run-stream: ## validate stdin and write it to stdout, errors to stderr
@node out/main.js \
@node out/index.js \
--config-path $(ROOT_PATH)/docs \
--config-name config-stderr.yml \
--dest - \

View File

@ -141,7 +141,7 @@ This project is written in Typescript and requires `node` and `yarn` to build.
> make
```
After building, run with: `node out/main.js`
After building, run with: `node out/index.js`
`make` targets are provided for some common arguments:

View File

@ -26,6 +26,10 @@ const bundle = {
return 'test'
}
if (id.includes('/src/index')) {
return 'index';
}
if (id.includes('/src/')) {
return 'main';
}
@ -33,7 +37,7 @@ const bundle = {
output: {
dir: 'out/',
chunkFileNames: '[name].js',
entryFileNames: 'index.js',
entryFileNames: 'entry-[name].js',
format: 'cjs',
sourcemap: true,
banner: () => {

View File

@ -2,9 +2,9 @@
"name": "salty-dog",
"version": "0.4.1",
"description": "YAML linter, transformer, and validator",
"main": "out/main.js",
"main": "out/index.js",
"bin": {
"salty-dog": "out/main.js"
"salty-dog": "out/index.js"
},
"directories": {
"doc": "docs",