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 metadata is not available in options hook #2624

Closed
AgronKabashi opened this issue Dec 31, 2018 · 1 comment · Fixed by #2642
Closed

Rollup metadata is not available in options hook #2624

AgronKabashi opened this issue Dec 31, 2018 · 1 comment · Fixed by #2642

Comments

@AgronKabashi
Copy link

According to the documentation and #2394, this.meta should be available in all plugin hooks. This does not seem to be the case for options however.

  • Rollup Version: >=0.65, 1.0
  • Operating System (or Browser): MacOS Mohave 10.14.2
  • Node Version: 9.3 & 10.3

How Do We Reproduce?

// Save this as test.config.js
export default {
  input: "test.config.js",
  output: {
    file: "build.js",
    format: "cjs"
  },
  plugins: [
    {
      resolveId () {
        console.log("ResolveId:", this.meta);
      },

      buildStart () {
        console.log("BuildStart:", this.meta);
      },

      options () {
        console.log("Options:", this.meta);
      }
    }
  ]
};

Run with npx rollup -c test.config.js

Output:

Options: undefined
BuildStart: { rollupVersion: '1.0.0' }
ResolveId: { rollupVersion: '1.0.0' }

Expected Behavior

The option hook should have access to the this.meta object and output the proper rollup version.

Actual Behavior

The option hook doesn't seem to have the proper context and thus this.meta is unavailable.

@lukastaegert
Copy link
Member

Fix at #2642

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

Successfully merging a pull request may close this issue.

2 participants