diff --git a/Dockerfile b/Dockerfile index 5551adb..36b129d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM node:current-alpine -WORKDIR /kill-sticky +WORKDIR /build/kill-sticky RUN set -x \ - && npm install uglify-js get-stdin mustache -g + && mkdir /build/node_modules \ + && npm install -g uglify-js mustache \ + && npm install get-stdin ENTRYPOINT uglifyjs README.md diff --git a/Makefile b/Makefile index eb39eab..d52c480 100644 --- a/Makefile +++ b/Makefile @@ -2,5 +2,5 @@ all: docker build . -t kill-sticky - docker run --rm -t -v $(shell pwd):/kill-sticky kill-sticky + docker run --rm -t -v $(shell pwd):/build/kill-sticky kill-sticky docker rmi kill-sticky diff --git a/README.md b/README.md index 0e3dad3..c6b7221 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ We're creating a bookmarklet, so our code needs to be minified and URL encoded. Run the following the project root directory: ```console -$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/kill-sticky kill-sticky +$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/build/kill-sticky kill-sticky ``` _This will update the project README.md with the build version._ diff --git a/src/README.mustache.md b/src/README.mustache.md index 848b457..82eb04c 100644 --- a/src/README.mustache.md +++ b/src/README.mustache.md @@ -72,7 +72,7 @@ We're creating a bookmarklet, so our code needs to be minified and URL encoded. Run the following the project root directory: ```console -$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/kill-sticky kill-sticky +$ docker build . -t kill-sticky && docker run --rm -it -v $(pwd):/build/kill-sticky kill-sticky ``` _This will update the project README.md with the build version._ diff --git a/src/bookmarkletify.js b/src/bookmarkletify.mjs similarity index 73% rename from src/bookmarkletify.js rename to src/bookmarkletify.mjs index a559662..4f565bc 100644 --- a/src/bookmarkletify.js +++ b/src/bookmarkletify.mjs @@ -1,4 +1,4 @@ -const getStdin = require('get-stdin'); +import getStdin from 'get-stdin'; getStdin().then(str => { console.log(`{"bookmarklet": "javascript:${encodeURIComponent(str)}"}`);