@shortex/perspective-esbuild-plugin

1.9.4 • Public • Published

@shortex/perspective-esbuild-plugin

Applications bundled with esbuild can make use of the @shortex/perspective-esbuild-plugin module. A full example can be found in the repo under examples/esbuild-example.

const esbuild = require("esbuild");
const {PerspectiveEsbuildPlugin} = require("@shortex/perspective-esbuild-plugin");

esbuild.build({
    entryPoints: ["src/index.js"],
    plugins: [PerspectiveEsbuildPlugin()],
    format: "esm",
    bundle: true,
    loader: {
        ".ttf": "file",
    },
});

When bundling via esbuild, you must also:

  • Use the type="module" attribute in your app's <script> tag, as this build mode is only supported via ES modules.
  • Use the direct imports for the esm versions Perspective, specifically @shortex/perspective/dsti/esm/perspective.js and @shortex/perspective-viewer/dist/esm/perspective-viewer.js

Readme

Keywords

none

Package Sidebar

Install

npm i @shortex/perspective-esbuild-plugin

Weekly Downloads

0

Version

1.9.4

License

Apache-2.0

Unpacked Size

38.1 kB

Total Files

16

Last publish

Collaborators

  • shortex