Comments (9)
Invited you 👍
from imagemin.
last thing: do you have a preferred Way of Working? Contributor's guide with maintainer section somewhere? Should I create branches and add you/someone as reviewer? Who pubs to NPM? I know you're super-busy, so I'm not sure you wish to be pinged for imagemin-related stuff. Perhaps you can point me to another active maintainer?
I don't have a guide. Just the normal best practices. New features should have tests. It's good to get a review on larger changes. Smaller changes can land directly on main
. Feel free to add me as a reviewer. There are no other active maintainers. It's easy to get burnt out on this project. If you have someone else that would be interested in reviewing your changes, that would be great too. You are free to publish new releases on npm.
from imagemin.
Exploring making the -bin libraries optional peerDependencies of the imagemin- plugins and making relying on the OS-installed dependencies the default (eg for using webp on Debian distro's, try calling webp first, which will fail if it is not in $PATH).
There are problems with relying on OS-installed dependencies too, like version incompatibilities.
I would suggest exploring using WASM for some of these as it fixes almost all compatibility problems.
For example, pngquant can be used from WASM: https://github.com/GoogleChromeLabs/squoosh/tree/dev/codecs/imagequant
from imagemin.
Also if you publish a major, can you make the package cjs compatible with an exports
in the package.json, it was recently made esm only and it's unpractical because the main usage of this package is in build tools which don't just don't have good esm support
from imagemin.
@Tofandel TBH this was also an issue for metalsmith-imagemin (which I pinned to the latest CJS-compatible imagemin plugins for my fork) as long as you support Node 12. FWIW you can use ESM modules in CJS builds by using dynamic imports starting in Node 13.something. Providing a dual build is definitely outside the scope of my involvement, but I could clarify in the README how to load it in a CJS build.
@sindresorhus last thing: do you have a preferred Way of Working? Contributor's guide with maintainer section somewhere? Should I create branches and add you/someone as reviewer? Who pubs to NPM? I know you're super-busy, so I'm not sure you wish to be pinged for imagemin-related stuff. Perhaps you can point me to another active maintainer? 😄
from imagemin.
You don't need a dual build but you do need a typescript base or a build step, I did it for @prerenderer by simply giving a cjs.js
file which imports the entry of the module
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const index_1 = __importDefault(require("./index"));
module.exports = index_1.default;
Or before building in ts
import def from './index'
export = def
And then in the package.json
remove the type: "module"
and add
"exports": {
"import": "./dist/index.js",
"require": "./dist/cjs.js"
},
Works wonders, as this allows for both require
and import
in node builds instead of just the import
that the type: "module"
does
from imagemin.
I don't intend to bring back CommonJS support.
from imagemin.
@ahmadnassri this thread should be of interest to you
Sindre mentioned
There are no other active maintainers. It's easy to get burnt out on this project. If you have someone else that would be interested in reviewing your changes, that would be great too.
Are you interested? If not I'm going to close this issue since I got invited to the GH org.
from imagemin.
@webketje thanks for the follow up, I don't think I can help with with a larger scope project like imagemin
at the moment.
from imagemin.
Related Issues (20)
- Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\xampp\htdocs\gulp-set-up\node_modules\gulp-imagemin\index.js HOT 22
- Vulnerabilities in dependencies flagged on npm audit HOT 3
- Error: Cannot find module node:buffer HOT 1
- destination path HOT 1
- Error: EMFILE: too many open files on W10
- gulp-imagemin: Could not load default plugin mozjpeg/optipng
- Not finding any files in my src directory HOT 1
- UnhandledPromiseRejectionWarning:/node_modules/imagemin/index.js:1 (function (exports, require, module, __filename, __dirname) { import {Buffer} from 'node:buffer';SyntaxError: Unexpected token {
- Question : Can we use this package in React-Native as well ? HOT 2
- Errors not thrown in 8.0.1
- Cannot read properties of undefined (reading 'buffer')
- file-type vulnerable to Infinite Loop via malformed MKV file HOT 2
- imagemin looping issue HOT 4
- Is it possible to convert a file coming from HTML input and upload to bucket without saving it to file system?
- TypeError: imagemin.svgo is not a function HOT 2
- error on svg HOT 1
- Destination path null HOT 1
- why not build commonjs module ? HOT 1
- imagemin not work (ERR_REQUIRE_ESM) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagemin.