Skip to content

feat: add loaders option to register#34

Open
angeloashmore wants to merge 1 commit into
egoist:masterfrom
angeloashmore:aa/loaders-config
Open

feat: add loaders option to register#34
angeloashmore wants to merge 1 commit into
egoist:masterfrom
angeloashmore:aa/loaders-config

Conversation

@angeloashmore

Copy link
Copy Markdown
  • Allow users to provide a loaders option to register()

This allows users to remap existing loaders or provide new ones. For example, a user may need to map .graphql files to a text loader.

Example:

require("esbuild-register/dist/node").register({
  target: `node${process.version.slice(1)}`,
  loaders: {
    ".js": "js",
    ".jsx": "jsx",
    ".ts": "ts",
    ".tsx": "tsx",
    ".mjs": "js",
    ".graphql": "text",
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant