Skip to content

Do a commonjs dist file for node, when using require plus example#1287

Merged
matux merged 5 commits into
masterfrom
matux/fix-require
Aug 7, 2025
Merged

Do a commonjs dist file for node, when using require plus example#1287
matux merged 5 commits into
masterfrom
matux/fix-require

Conversation

@matux

@matux matux commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

Description of the change

This PR adds a new distribution intended specifically for Node applications that use require to integrate Rollbar instead of import.

Related issues

@matux matux requested a review from Copilot August 7, 2025 15:38
@matux matux self-assigned this Aug 7, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new CommonJS distribution build specifically for Node.js applications that use require() instead of import to integrate Rollbar.

  • Adds webpack configuration to build a CommonJS distribution file for Node.js
  • Updates package.json to point to the new dist file for CommonJS usage
  • Removes the existing CJS wrapper file and creates a proper webpack build
  • Includes an example Node.js application demonstrating the CommonJS usage

Reviewed Changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.config.cjs Adds new server CJS build configuration and modernizes variable declarations
src/server/rollbar.cjs Removes the existing CommonJS wrapper file
package.json Updates main entry and require paths to point to new dist file, adds webpack-node-externals dependency
examples/node-require/package.json Creates example package configuration for Node.js CommonJS usage
examples/node-require/index.js Provides example Node.js server using Rollbar with require()

Comment thread webpack.config.cjs
Comment thread examples/node-require/index.js
@matux matux enabled auto-merge (squash) August 7, 2025 21:31
@matux matux merged commit 484732d into master Aug 7, 2025
4 checks passed
@matux matux deleted the matux/fix-require branch August 7, 2025 21:36
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