Files
next.js/rspack/lib/index.js
Cong-Cong PanandGitHub c0d94dc1ac feat: next-rspack-binding (#82811)
Added a new `rspack` directory as an independent Rust and pnpm
workspace, dedicated to building Next.js Rspack bindings. It shares code
with Turbopack through the `next-taskless` crate.
2025-09-18 16:03:02 +00:00

24 lines
564 B
JavaScript

process.env.RSPACK_BINDING = require('node:path').dirname(
require.resolve('@next/rspack-binding')
)
const binding = require('@next/rspack-binding')
// Register the plugin `NextExternalsPlugin` exported by `crates/binding/src/lib.rs`.
binding.registerNextExternalsPlugin()
const core = require('@rspack/core')
const NextExternalsPlugin = core.experiments.createNativePlugin(
'NextExternalsPlugin',
function (options) {
return options
}
)
Object.defineProperty(core, 'NextExternalsPlugin', {
value: NextExternalsPlugin,
})
module.exports = core