From a0308610a6bed14150c8f7e98ed5b5fc9511bd05 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 23 May 2024 19:57:19 +0300 Subject: [PATCH] docs: assume tree-shaking bundler is the most common case (#5160) Refs: https://github.com/transloadit/uppy/pull/4730 --- docs/guides/building-plugins.md | 2 +- docs/uppy-core.mdx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/guides/building-plugins.md b/docs/guides/building-plugins.md index 11fe7035c1..d6b44178cf 100644 --- a/docs/guides/building-plugins.md +++ b/docs/guides/building-plugins.md @@ -33,7 +33,7 @@ The plugin constructor receives the Uppy instance in the first parameter, and any options passed to `uppy.use()` in the second parameter. ```js -import BasePlugin from '@uppy/core/lib/BasePlugin.js'; +import BasePlugin from '@uppy/core'; export default class MyPlugin extends BasePlugin { constructor(uppy, opts) { diff --git a/docs/uppy-core.mdx b/docs/uppy-core.mdx index 0d507bfc15..a74a07e2e8 100644 --- a/docs/uppy-core.mdx +++ b/docs/uppy-core.mdx @@ -1356,9 +1356,10 @@ Checkout the [building plugins](/docs/guides/building-plugins) guide. :::note -If you don’t use any UI plugins and want to make sure Preact isn’t bundled into -your app, import `BasePlugin` like this: -`import BasePlugin from '@uppy/core/lib/BasePlugin`. +If you don’t use any UI plugins, any modern bundler should be able to tree-shake +Preact code away. If you are not using a bundler that supports tree-shaking, +it’s also possible to import `BasePlugin` like this: +`import BasePlugin from '@uppy/core/lib/BasePlugin.js`. :::