Next.js: upgrade next-transpile-modules#19
Conversation
+ change to babel-plugin-transform-import-ignore + use `presets: ["next/babel"]`
|
Have come across a few developers getting pretty stumped by this out of date example, so would be great to get this merged to prevent further confusion. |
|
I can take a look at bringing the PR into a mergeable state again if it is relevant. @arshaw? |
|
Thank you for this! I'll echo what @dangreaves said - this is something that confused me. next-transpile-modules is 3 major versions out of date in this example. |
| const withTM = require('next-transpile-modules')([ | ||
| '@fullcalendar' | ||
| // Need to specify all @fullcalendar modules separately | ||
| // with next-transpile-modules^6.x … |
There was a problem hiding this comment.
As mentioned above this PR is good but I'd refer folks to the next-transpile-modules compatibility table as well.
|
Thanks @bjrn for this PR and updated examples! Helped me get this library up and running in my project. It is quite the shame that maintainers haven't merged this in. |
|
Thank you so much for this. I don't know why the owner hasn't committed. The example out of the box doesn't work. |
|
your |
|
Thank you very much! Your update is helpful!!! |
|
Thank you I wasn't able to make it work with the current info in the readme, and this worked. Thank you for sharing |
|
Thank you a lot for this! This cleared it up and it works now - wish they'd merge this |
|
thanks for this, very helpful |
|
I'm not quite sure when this change occurred, but as of FullCalendar 5.11.0 and Next.js 12.1.6, using Babel is no longer necessary. SWC, Next.js' new web compiler, does not require a separate plugin to ignore the importing of the CSS files. |
Upgrading next-transpile-modules from 4.1.0 to 6.3.0 broke this workaround. Here's an attempt to fix it
'next/babel'preset instead of'@babel/preset-react'babel-plugin-transform-require-ignorewithbabel-plugin-transform-import-ignoreas the compiled@fullcalendarmodules seems to useimport main.css;, and not require.next.config.jsthe new version ofnext-transpile-modulesrequires us to specify all paths to the modules (just@fullcalendarlike this solution used to have doesn't seem to work anymore)Regarding the removal of
babel-plugin-transform-import-ignore, it doesn't seem to do any harm leaving it in there, but for this purpose, I found it necessary to usebabel-plugin-transform-import-ignoreinstead. Now I'm no wizard on neither Babel nor Webpack, but the latter seemed sufficient in this example.