Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup: Could not resolve import "filedirname" #157

Open
derolf opened this issue Oct 12, 2021 · 2 comments
Open

Rollup: Could not resolve import "filedirname" #157

derolf opened this issue Oct 12, 2021 · 2 comments

Comments

@derolf
Copy link

derolf commented Oct 12, 2021

I get the following error with rollup:

(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
filedirname (imported by src/global.ts)
...
(!) Plugin node-resolve: Could not resolve import "filedirname" in /xxx/src/global.ts using exports defined in /xxx/node_modules/.pnpm/[email protected]/node_modules/filedirname/package.json.

My rollup.config.js:

import run from "@rollup/plugin-run";
import babel from "@rollup/plugin-babel";
import nodeResolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";

const isDev = process.env.NODE_ENV !== "production";

const extensions = [".js", ".jsx", ".es6", ".es", ".mjs", ".ts"];

export default {
  input: "src/index.ts",
  output: {
    file: "build/index.js",
    format: "es",
    sourcemap: true,
  },
  plugins: [commonjs(), nodeResolve({ extensions, preferBuiltins: true }), json(), babel({ extensions }), isDev && run()],
};

Note: I tried different orderings in plugins: All result in the same error

@balupton
Copy link
Member

Is this still an issue? If it is you can probably either change your import to a specific edition, or make a plugin for rollup to support https://editions.bevry.me

That said, this isn't for web browsers, which is typically what rollup is for. What environment are you targeting?

closing for now

@balupton balupton closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2024
@balupton
Copy link
Member

balupton commented Jan 20, 2024

Actually my bad. This project should support web browsers, I just haven't enabled the browsers toggle in boundation. Will fix it up soon.

@balupton balupton reopened this Jan 20, 2024
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

No branches or pull requests

2 participants