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

Update plugin rollup polyfill package #3621

Merged
merged 4 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/ReExports/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default [
'mobx',
'mobx-state-tree',
'react',
'react/jsx-runtime',
'react-dom',
'mobx-react',
'@mui/x-data-grid',
Expand Down
2 changes: 2 additions & 0 deletions packages/core/ReExports/modules.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// this is all the stuff that the pluginManager re-exports for plugins to use
import React, { lazy, LazyExoticComponent, Suspense } from 'react'
import * as ReactJSXRuntime from 'react/jsx-runtime'
import * as ReactDom from 'react-dom'
import * as mobx from 'mobx'
import * as mst from 'mobx-state-tree'
Expand Down Expand Up @@ -503,6 +504,7 @@ const libs = {
mobx,
'mobx-state-tree': mst,
react: React,
'react/jsx-runtime': ReactJSXRuntime,
'react-dom': ReactDom,
'mobx-react': mxreact,
'@mui/x-data-grid': {
Expand Down
6 changes: 2 additions & 4 deletions plugin-development-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"chalk": "^4.1.1",
"lodash.merge": "^4.6.2",
"rollup-plugin-external-globals": "^0.6.1",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-polyfill-node": "^0.12.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-terser": "^7.0.2"
},
Expand All @@ -58,8 +57,7 @@
"typescript": "^4.0.0"
},
"devDependencies": {
"@types/rollup-plugin-node-builtins": "^2.1.2",
"@types/rollup-plugin-node-globals": "^1.4.1",
"rimraf": "^4.1.2",
"rollup": "^2.77.0",
"typescript": "^4.7.4"
},
Expand Down
10 changes: 6 additions & 4 deletions plugin-development-tools/src/createRollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import typescript from '@rollup/plugin-typescript'
import path from 'path'
import { defineConfig, OutputOptions, Plugin, RollupOptions } from 'rollup'
import externalGlobals from 'rollup-plugin-external-globals'
import builtins from 'rollup-plugin-node-builtins'
import globals from 'rollup-plugin-node-globals'
import nodePolyfills from 'rollup-plugin-polyfill-node'
import sourceMaps from 'rollup-plugin-sourcemaps'
import { terser } from 'rollup-plugin-terser'
import { babelPluginJBrowse } from './babelPluginJBrowse'
Expand Down Expand Up @@ -86,8 +85,11 @@ function getPlugins(
}),
mode === 'npm' && sourceMaps(),
mode === 'npm' && writeIndex(packageName, distPath),
(mode === 'esmBundle' || mode === 'umd') && globals(),
(mode === 'esmBundle' || mode === 'umd') && builtins(),
(mode === 'esmBundle' || mode === 'umd') &&
// By default, nodePolyfills only polyfills code in node_modules/. We set
// to null here to include the plugin source code itself (and for Yarn 2/3
// compatibility, since it doesn't use node_modules/).
nodePolyfills({ include: null }),
cmdcolin marked this conversation as resolved.
Show resolved Hide resolved
(mode === 'cjs' || mode === 'esmBundle') && omitUnresolved(),
].filter(Boolean)

Expand Down
Loading