This example demonstrates the use of the packageJson
option to work with the sharp
package for image manipulation, which can't be bundled by webpack because it has native dependencies.
-
Node 8+.
-
TypeScript 3.3 or above. Install globally:
$ npm install -g typescript
$ npm install
$ npm run build
$ node dist/index.js
wrote output.png
output.png
should be the same as expected-output.png
, which is this image: