Closed asos-tomp closed 3 weeks ago
Maybe we may support one for Wasm, but your plugin is for webpack, a bundler, not babel. Also, I read the thread you linked but swc-loader
does not read file directly from the file system. We just use source code provided by webpack.
@kdy1 Next.js does not use swc-loader
by default, at least not in the latest version. Instead Next.js ships its own integration with SWC, @next/swc
which reads files directly from the file system.
https://github.com/vercel/next.js/blob/ca559a5281ff2e2f345cc45e4d05a82e7ba83c9f/crates/napi/src/transform.rs#L118-L120
The issue should be opened against Next.js repo, I think.
Thanks @larixer - much appreciated for clarifying for me. Will raise an issue against Next.
Addition, seems direct file reading into @next/swc
was added via this PR:
https://github.com/vercel/next.js/pull/31682
Looks like next-swc-loader
is the last loader and because of this file reading is "accelerated" by delegating it to Rust code.
See: https://github.com/vercel/next.js/discussions/71714 raised earlier
Describe the feature
Work off virtualised filesystems. e.g. In memory.
Babel plugin or link to the feature description
https://github.com/sysgears/webpack-virtual-modules/issues/169
Additional context
I appreciate the purpose of SWC is speed/efficiency, and this perhaps may only be gleaned by focussing on raw metal, but wondered if there was any possibility to work from a virtualised filesystem, e.g. memfs?
I have a plugin that works fine with NextJs (WebPack + Babel) but fails with WebPack + SWC, since the abstract
compiler.inputFileSystem
concept doesn't appear to be fully supported.