Skip to content

feat: allow edit of commonJs plugin params#187

Merged
pi0 merged 6 commits intonitrojs:mainfrom
huang-julien:feat/rollup-commonjs-config
May 4, 2022
Merged

feat: allow edit of commonJs plugin params#187
pi0 merged 6 commits intonitrojs:mainfrom
huang-julien:feat/rollup-commonjs-config

Conversation

@huang-julien
Copy link
Copy Markdown
Contributor

@huang-julien huang-julien commented May 3, 2022

  • add commonjs field to edit the commonjs plugin

🔗 Linked issue

nuxt/framework#4762
nuxt/nuxt#13843

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Add the commonJs key to NitroOptions and assign by destructuring nitro.option.commonJs when adding the @rollup/plugin-commonjs.
Would improve the linked PR by avoiding replacing the commonJS plugin at build. The commonJS dynamicRequireTargets declaration would be directly into nitro/nuxt config

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

- add commonjs field to edit the commonjs plugin
externals: NodeExternalsOptions
analyze: false | PluginVisualizerOptions
replace: Record<string, string | ((id: string) => string)>
commonJs?: RollupCommonJSOptions
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use commonJS for naming?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍

Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would be nice to also update docs (config reference to mention this new option)

Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

3 participants