Skip to content
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

Fixes #366: Add compatibility for using CommonJs #381

Closed
wants to merge 2 commits into from

Commits on Feb 15, 2024

  1. Add compatibility for using CommonJs since this package is intended f…

    …or GulpJs which does yet support ES6,
    
     - Install common-exports to be able to convert the package to CommonJs.
     - Update the package to not be type=module.
     - Update the file extensions to .mjs (I also don't like this, but the alternative of .cjs was not compatible)
     - Add a gulpfile.js and babel.config.js to be able to run common-exports.
     - Create the CommonJs files in a new cjs directory.
     - Add a duplicate of the test.js file to be able to test the CommonJs compiled files.
     - Add signal-exit since the latest version is a dependency of mozjpeg to prevent failures with onExit missing.
    jheagle committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    4df58b3 View commit details
    Browse the repository at this point in the history
  2. - For xo, it is important to exclude the cjs directory since those a…

    …re compiled files
    
     - There are three files (test.js, gulpfile.js and babel.config.js) which necessarily use require syntax. To remove these errors, I have reduced prefer-module level to warning.
    jheagle committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    71acdf5 View commit details
    Browse the repository at this point in the history