Skip to content

ES Module Bundling issue #135

Open
Open
@Alteras1

Description

@Alteras1

Hello!

Looks like there's an issue with bundling the es modules. I'm trying to wrap it inside my own package with its own set of bbcode tags, and when I bundle it to esm or cjs (using rollup), I get quite a few "___ is not exported by ___" errors. Looks like it's because some import statements use the /lib directory.

i.e.

[!] Error: 'SLASH' is not exported by node_modules/BBob/packages/bbob-plugin-helper/lib/char.js, imported by node_modules/BBob/packages/bbob-parser/es/Token.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/BBob/packages/bbob-parser/es/Token.js (1:36)
1: import { OPEN_BRAKET, CLOSE_BRAKET, SLASH } from '@bbob/plugin-helper/lib/char';

This is my rollup.config.js, where src/index.ts imports @bbob/html, @bbob/preset, and @bbob/core, and applies its own set of tags.

import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import pkg from "./package.json";

export default [

  // CommonJS (for Node) and ES module (for bundlers) build.
  {
    input: "src/index.ts",
    output: [
      { file: pkg.main, format: "cjs", sourcemap: true },
      { file: pkg.module, format: "es", sourcemap: true },
    ],
    plugins: [resolve(), typescript({ tsconfig: "./tsconfig.json" })],
  },
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Moderate IssuebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions