-
-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch from browserify to webpack #1140
Changes from all commits
831bc3c
8c7ba83
f8b4567
4042b43
e3ff49d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,4 @@ package-lock.json | |
dist/ | ||
# ESM Version | ||
es/ | ||
jimp.js.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,21 +77,6 @@ If you're using a web bundles (webpack, rollup, parcel) you can benefit from usi | |
import Jimp from "jimp/es"; | ||
``` | ||
|
||
### WebPack | ||
|
||
If you're using webpack you can set `process.browser` to true and your build of jimp will exclude certain parts, making it load faster. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a problem anymore and was always a misunderstanding on how to make a browser bundle 😓 |
||
|
||
```js | ||
{ | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.browser': 'true' | ||
}), | ||
... | ||
], | ||
} | ||
``` | ||
|
||
## Basic usage | ||
|
||
The static `Jimp.read` method takes the path to a file, URL, dimensions, a Jimp instance or a buffer and returns a Promise: | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,7 @@ | |
"main": "dist/index.js", | ||
"module": "es/index.js", | ||
"types": "types/index.d.ts", | ||
"typesVersions": { | ||
">=3.1.0-0": { | ||
"*": [ | ||
"types/ts3.1/index.d.ts" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not interested in supporting ancient TS versions |
||
] | ||
} | ||
}, | ||
"browser": "browser/lib/jimp.js", | ||
"tonicExampleFilename": "example.js", | ||
"files": [ | ||
"browser", | ||
|
@@ -26,16 +20,15 @@ | |
"test": "cross-env BABEL_ENV=test mocha --require @babel/register", | ||
"test:watch": "npm run test -- --reporter min --watch", | ||
"test:coverage": "nyc npm run test", | ||
"browser-build": "node tools/browser-build.js test", | ||
"build": "npm run build:browser && npm run build:node:production && npm run build:module", | ||
"build:watch": "npm run build:node:debug -- -- --watch --verbose", | ||
"build:debug": "npm run build:browser:debug && npm run build:node:debug", | ||
"build:module": "cross-env BABEL_ENV=module babel src -d es --source-maps --config-file ../../babel.config.js", | ||
"build:node": "babel src -d dist --source-maps --config-file ../../babel.config.js", | ||
"build:node:debug": "cross-env BABEL_ENV=development npm run build:node", | ||
"build:node:production": "cross-env BABEL_ENV=production npm run build:node", | ||
"build:browser": "cross-env BABEL_ENV=production node tools/browser-build.js prepublish", | ||
"build:browser:debug": "cross-env BABEL_ENV=development ENV=browser node tools/browser-build.js prepublish" | ||
"build:browser": "cross-env NODE_ENV=production webpack", | ||
"build:browser:debug": "cross-env NODE_ENV=development ENV=browser webpack" | ||
}, | ||
"keywords": [ | ||
"image", | ||
|
@@ -70,27 +63,11 @@ | |
"babel-plugin-add-module-exports": "^1.0.2", | ||
"babel-plugin-istanbul": "^5.2.0", | ||
"babel-plugin-source-map-support": "^2.1.1", | ||
"babelify": "^10.0.0", | ||
"browserify": "^16.5.0", | ||
"cross-env": "^6.0.0", | ||
"dtslint": "^0.9.8", | ||
"envify": "^4.1.0", | ||
"eslint": "^6.4.0", | ||
"express": "^4.17.1", | ||
"husky": "^3.0.5", | ||
"karma": "^4.3.0", | ||
"karma-browserify": "^6.1.0", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-firefox-launcher": "^1.2.0", | ||
"lerna": "^3.16.4", | ||
"lerna-changelog": "^0.8.2", | ||
"lint-staged": "^9.2.5", | ||
"mocha": "^6.2.0", | ||
"nyc": "^14.1.1", | ||
"path-browserify": "^1.0.1", | ||
"source-map-support": "^0.5.13", | ||
"tfilter": "^1.0.1", | ||
"uglify-js": "^3.6.0", | ||
"watchify": "^3.11.1" | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.1" | ||
}, | ||
"nyc": { | ||
"sourceMap": false, | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We weren't caching all the build files so that's why they weren't there