Transpile nuxt2 module
See original GitHub issueI’m creating a nuxt module for both: nuxt2 and nuxt3. However I’m having some trouble by building a nuxt2 project by using nuxt generate. The module is using the OhMyFetch module which is not transpiled. Does anyone know what I have to do to get this fixed? I’m getting these kind of import errors:
Basically what I do is the following:
- I do use the https://github.com/nuxt/module-builder template.
- The build
nuxt-module-build
is going correctly and all files are generated. - At this point I use npm publish for github package registry
- When adding the (build)module I’m getting some node-fetch / ohmyfetch related errors:
Can't resolve 'node:buffer' Can't resolve 'node:http' ...
Also I do have tried the build.transpile: ['module-name] config. Any thoughts? Thanks 😄
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
How can I transpile a dependency in node_modules with ...
I have read of issues with transpiling node_modules with Nuxt, but the new Nuxt 2 is said to have solved this with a...
Read more >Add support to transpile modules inside node_modules
One solution would be to transpile it as stated above, we've just downgraded the module to v5 (which is plain ES5). 1
Read more >How can I transpile a dependency in node_modules with Nuxt ...
Coding example for the question How can I transpile a dependency in node_modules with Nuxt 2?-babel.js.
Read more >The build Property
Display build indicator for hot module replacement in development ... In this example, ky will be transpiled by Babel if Nuxt is not...
Read more >Introduction to Nuxt 3 modules
For the previous version of Nuxt (also the most stable right now), we had a repository template for building new Nuxt 2 modules...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am reluctant to dispense such unlimited agreement 😜
But I don’t believe webpack 5 has this issue.
Thx a lot 🙏