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

Ability to use a virtualised filesystem #9671

Closed
asos-tomp opened this issue Oct 23, 2024 · 6 comments
Closed

Ability to use a virtualised filesystem #9671

asos-tomp opened this issue Oct 23, 2024 · 6 comments

Comments

@asos-tomp
Copy link

asos-tomp commented Oct 23, 2024

Describe the feature

Work off virtualised filesystems. e.g. In memory.

Babel plugin or link to the feature description

sysgears/webpack-virtual-modules#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.

@kdy1
Copy link
Member

kdy1 commented Oct 23, 2024

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 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2024
@larixer
Copy link

larixer commented Oct 23, 2024

@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.

@asos-tomp
Copy link
Author

Thanks @larixer - much appreciated for clarifying for me. Will raise an issue against Next.

@larixer
Copy link

larixer commented Oct 23, 2024

Addition, seems direct file reading into @next/swc was added via this PR:
vercel/next.js#31682
Looks like next-swc-loader is the last loader and because of this file reading is "accelerated" by delegating it to Rust code.

@asos-tomp
Copy link
Author

See: vercel/next.js#71714 raised earlier

@swc-bot
Copy link
Collaborator

swc-bot commented Nov 23, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants