mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Add Node ESM Loader and Register Entrypoints (#20274)
* Add Node ESM loader build This adds a loader build as a first-class export. This will grow in complexity so it deserves its own module. * Add Node CommonJS regiter build This adds a build as a first-class export for legacy CommonJS registration in Node.js. This will grow in complexity so it deserves its own module. * Simplify fixture a bit to easier show usage with or without esm * Bump es version We leave async function in here which are newer than ES2015.
This commit is contained in:
committed by
GitHub
parent
d56c282c1d
commit
bbaee487c0
@@ -286,6 +286,24 @@ const bundles = [
|
||||
externals: [],
|
||||
},
|
||||
|
||||
/******* React Transport DOM Webpack Node.js Loader *******/
|
||||
{
|
||||
bundleTypes: [NODE_ESM],
|
||||
moduleType: RENDERER_UTILS,
|
||||
entry: 'react-transport-dom-webpack/node-loader',
|
||||
global: 'ReactFlightWebpackNodeLoader',
|
||||
externals: [],
|
||||
},
|
||||
|
||||
/******* React Transport DOM Webpack Node.js CommonJS Loader *******/
|
||||
{
|
||||
bundleTypes: [NODE_ES2015],
|
||||
moduleType: RENDERER_UTILS,
|
||||
entry: 'react-transport-dom-webpack/node-register',
|
||||
global: 'ReactFlightWebpackNodeRegister',
|
||||
externals: ['url'],
|
||||
},
|
||||
|
||||
/******* React Transport DOM Server Relay *******/
|
||||
{
|
||||
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD],
|
||||
|
||||
@@ -45,7 +45,7 @@ module.exports = {
|
||||
jest: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2015,
|
||||
ecmaVersion: 2017,
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
const esNextPaths = [
|
||||
// Internal forwarding modules
|
||||
'packages/*/*.js',
|
||||
'packages/*/esm/*.js',
|
||||
// Source files
|
||||
'packages/*/src/**/*.js',
|
||||
'packages/dom-event-testing-library/**/*.js',
|
||||
|
||||
Reference in New Issue
Block a user