fix(build): split index into its own chunk
This commit is contained in:
parent
96d15bb480
commit
8351fff973
|
@ -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 first, to invalidate other layers when version changes
|
||||||
COPY package.json /salty-dog/package.json
|
COPY package.json /salty-dog/package.json
|
||||||
COPY out/vendor.js /salty-dog/out/vendor.js
|
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 out/main.js /salty-dog/out/main.js
|
||||||
|
|
||||||
COPY rules /salty-dog/rules
|
COPY rules /salty-dog/rules
|
||||||
|
|
||||||
ENTRYPOINT [ "node", "/salty-dog/out/main.js" ]
|
ENTRYPOINT [ "node", "/salty-dog/out/index.js" ]
|
4
Makefile
4
Makefile
|
@ -121,7 +121,7 @@ run-rules: ## validate the rules directory
|
||||||
find $(ROOT_PATH)/rules -maxdepth 1 -name '*.yml' | while read file; \
|
find $(ROOT_PATH)/rules -maxdepth 1 -name '*.yml' | while read file; \
|
||||||
do \
|
do \
|
||||||
echo "Validating $${file}..."; \
|
echo "Validating $${file}..."; \
|
||||||
node out/main.js \
|
node out/index.js \
|
||||||
--config-path $(ROOT_PATH)/docs \
|
--config-path $(ROOT_PATH)/docs \
|
||||||
--config-name config-stderr.yml \
|
--config-name config-stderr.yml \
|
||||||
--rules $(ROOT_PATH)/rules/salty-dog.yml \
|
--rules $(ROOT_PATH)/rules/salty-dog.yml \
|
||||||
|
@ -130,7 +130,7 @@ run-rules: ## validate the rules directory
|
||||||
done
|
done
|
||||||
|
|
||||||
run-stream: ## validate stdin and write it to stdout, errors to stderr
|
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-path $(ROOT_PATH)/docs \
|
||||||
--config-name config-stderr.yml \
|
--config-name config-stderr.yml \
|
||||||
--dest - \
|
--dest - \
|
||||||
|
|
|
@ -141,7 +141,7 @@ This project is written in Typescript and requires `node` and `yarn` to build.
|
||||||
> make
|
> 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:
|
`make` targets are provided for some common arguments:
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,10 @@ const bundle = {
|
||||||
return 'test'
|
return 'test'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (id.includes('/src/index')) {
|
||||||
|
return 'index';
|
||||||
|
}
|
||||||
|
|
||||||
if (id.includes('/src/')) {
|
if (id.includes('/src/')) {
|
||||||
return 'main';
|
return 'main';
|
||||||
}
|
}
|
||||||
|
@ -33,7 +37,7 @@ const bundle = {
|
||||||
output: {
|
output: {
|
||||||
dir: 'out/',
|
dir: 'out/',
|
||||||
chunkFileNames: '[name].js',
|
chunkFileNames: '[name].js',
|
||||||
entryFileNames: 'index.js',
|
entryFileNames: 'entry-[name].js',
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
banner: () => {
|
banner: () => {
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
"name": "salty-dog",
|
"name": "salty-dog",
|
||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
"description": "YAML linter, transformer, and validator",
|
"description": "YAML linter, transformer, and validator",
|
||||||
"main": "out/main.js",
|
"main": "out/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
"salty-dog": "out/main.js"
|
"salty-dog": "out/index.js"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "docs",
|
"doc": "docs",
|
||||||
|
|
Loading…
Reference in New Issue