Skip to content

Releases: martpie/next-transpile-modules

The End.

22 Dec 15:32
Compare
Choose a tag to compare

This is the end, beautiful friend
This is the end, my only friend
The end of our elaborate plans
The end of everything that stands

All features of next-transpile-modules are now natively integrated in Next.js 13.1: next-transpile-modules is now officially deprecated, and the repository will be archived soon.

This adventure started on Aug. 9 2018, and it's been a few lost hair, big learnings, and a lot of fun 😄.

First, a few thanks...

I would like to thank all the contributors who helped with the project, your help was precious!

Also, last year or two years ago, I opened a sponsor page to help support my work. I would like to thank all the contributors for their help, it allowed me to get $670, plus an exceptional contribution from GitHub of $500, for a total of $1270.

I don't really need this money, and I will donate it to a charity I care a lot about, based in France, helping troubled youngsters to be reintegrated into society through work, contact with animals and nature, and self-respect.

Migration guide

Upgrade to Next.js 13.1, then in next.config.js:

-const withTM = require('next-transpile-modules')(['awesome_module']);

-module.exports = withTM({});
+module.exports = {
+  transpilePackages: ['awesome_module'],
+};

Boom you're done!

That's all!

Merry Christmas, happy new year, and happy coding! :)


Post-end patches

10.0.1

  • Compatibility with 13.4

10.0.0

01 Nov 16:05
Compare
Choose a tag to compare

Hello everyone! No breaking changes in this version, I just bumped it to make sure people are careful when upgrading to Next.js 13. Please make sure to read the additional notes below regarding the future of next-transpile-modules and Turbopack.

If you appreciate my work, and if you can afford it, you (or better, your company) can show support by sponsoring me (or just buying me a beer 🙌).

Support for Next.js 13

Enjoy!

Experimental support for the app/ directory

Next.js 13 comes with beta support for the new app/ directory, and next-transpile-modules supports it.

Please think twice before using this feature as it's still experimental and next-transpile-modules could break at any of Next.js commit.

Note on Turbopack

Turbopack being in alpha, next-transpile-modules will not be supporting it. It may work out of the box, it may not, I will not work on it before it's more stable.

Note on the future of next-transpile-modules and transpilePackages

Next.js 13 comes with a new option called transpilePackages. This new experimental feature currently allows to transpile local and npm ES modules, so you might not need next-transpile-modules anymore, ifyou're ready to enable experimental features on Next.js.

That said, and this is great news, the Next.js team is working on feature parity with next-transpile-modules, so next-transpile-modules will disappear some day in the future.

There is no clear timeline yet, so in the meantime, I'll keep maintaining this plugin until:

  • transpilePackages is not experimental anymore
  • transpilePackages has feature parity with next-transpile-modules

That's it!

Take care of yourselves and happy coding!

9.1.0

10 Oct 14:54
Compare
Choose a tag to compare
  • Add TS typings to the plugin (for better autocomplete), thanks @belgattitude!
  • Internal dependencies update

9.0.0

27 Oct 09:26
05437e6
Compare
Choose a tag to compare

Chop chop! Next.js 12 yesterday, next-transpile-modules@9 today :] As always the breaking changes are indicated by the ⚠️ icon.

If you appreciate my work, and if you can afford it, you (or better, your company) can show support by sponsoring me (or just buying me a beer 🙌).

Support for Next.js 12

Nothing much to say. You should definitely upgrade, that's an amazing release!

Removed support for Webpack 4 ⚠️

What it says, next-transpile-modules is aligned with Next.js releases, so no more Webpack 4.

Removed support for legacy module resolution ⚠️

If you have seen in your logs with v8 the following warning:

DEPRECATED - fallbacking to previous module resolution system for module "XXX", you can now just pass the name of the package to transpile and it will detect its real path without you having to pass a sub-module.

this is for you.

You can read the 7.1.0 version changelog for a detailed explanation, but basically, what you want to do now is the following:

const withTM = require('next-transpile-modules')([
- 'some/very/specific/file.js'
+ 'some'
]);

8.0.0

15 Jun 18:55
Compare
Choose a tag to compare

Following the Next.js 11 announcement, next-transpile-modules v8 is here. Technically v7 should work fine, but there was a default change, so I mark this as a major version.

The breaking changes are indicated by the ⚠️ icon.

Webpack 5 enabled by default ⚠️

If you don't have any webpack5 key in your next.config.js, next-transpile-modules will assume you use Webpack 5.

If you already have Webpack 5 enabled, nothing changes for you. If you want to stick with Webpack 4, you can see how to disable Webpack 5 here.

It is of course strongly recommended to upgrade to Webpack 5, as it brings substantial improvements to compilation time!

next-transpile-modules will keep supporting Webpack 4 as long as Next.js does, and we'll gladly kill it with fire when Next.js won't support it no more :)

Cheers!

7.3.0

09 Jun 22:16
Compare
Choose a tag to compare
  • Added support for top-level webpack5 configuration (next@canary)

7.2.0

21 May 12:28
Compare
Choose a tag to compare
  • Added support for Global CSS imports from modules located in node_modules (thank you @fabianishere!)

7.1.2

19 May 14:22
Compare
Choose a tag to compare
  • Fixed false-positive deprecation warnings on Webpack 4 setups

7.1.1

18 May 09:56
Compare
Choose a tag to compare
  • Fixed new package lookup for packages using exports field
  • Fixed code that should have not been shipped yet

7.1.0

17 May 20:17
Compare
Choose a tag to compare
  • Added new package lookup resolution
  • Deprecated specific package file lookup

When trying to locate the packages you are trying to transpile, since v5, next-transpile-modules tries to resolve your module names you pass to it, which required a valid main or exports field. It will now tries to resolve directly to its package.json.

This should solve the issue for some people who did not want to use the main/exports fields for their local packages, and some others who wanted to use local packages locally while publishing them on NPM as well.

If next-transpile-modules cannot find your package package.json, it will fallback to the previous lookup system (a deprecation warning was added), so no breaking change is expected.

Basically, for the few that were using something like:

const withTM = require('next-transpile-modules')(['some/very/specific/file.js']);

You should now be able to use:

const withTM = require('next-transpile-modules')(['some']);

...and everything will work fine.