Git Product home page Git Product logo

esbuild-plugin-global-externals's Introduction

Haxe projects

Game made with Haxe and HaxeFlixel:

Haxe-based language for 2D shmups bullet patterns:

Haxe libraries:

TypeScript projects

Sketches made with p5.js (old ones are with Processing):

NPM libraries for Node.js:

Browser-based tool:

Other projects with p5.js:

esbuild-plugin-global-externals's People

Contributors

arcath avatar fal-works avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

arcath renanvaz

esbuild-plugin-global-externals's Issues

Equivalent functionality in rollup

Hi there, this plugin works great with Vite 5 in dev mode. I used to pre-bundle with esbuild for production (build) with Vite 3 but they've removed this in Vite 5 and so I was wondering if there was an equivalent plugin that you know of for rollup?

How to allow all named imports from module without specifying them in namedExports

My esbuild-config looks like this:

import { eslintPlugin } from "esbuild-plugin-eslinter";
import { build } from "esbuild";
import { copy } from "esbuild-plugin-copy";
import { globalExternals } from "@fal-works/esbuild-plugin-global-externals";

const inputFiles = ["src/index.tsx"];

export const build = () => {
  const globals = {
    "styled-components": "Styled",
    react: "React",
    "react-dom": "ReactDOM",
  };

  build({
    entryPoints: inputFiles,
    outfile: "dist/index_ext.js",
    define: {
      global: "window",
    },
    bundle: true,
    minify: true,
    sourcemap: false,
    format: "esm",
    external: ["styled-components", "react", "react-dom"],
    plugins: [globalExternals(globals)],
  }).catch(() => process.exit(1));
};

and I do the following in a file:

import * as Styled from "styled-components";

window["Styled"] = Styled;
// Same thing for other libraries too

However I get

[ERROR] No matching export in "global-externals:styled-components" for import "css"

For each of the external libraries. I'm a bit lost in how I could proceed with debugging this. Did I misunderstand how the concept of global externals is actually working?

Thanks for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.