mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
24 lines
564 B
JavaScript
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
|