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

fix(NODE-6732): test and fix webpack bundling #230

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Conversation

durran
Copy link
Member

@durran durran commented Feb 10, 2025

Description

Fixes webpack bundling and adds tests.

What is changing?

  • Fixes the require to be able to be bundled by wekbpack and adds tests.
Is there new documentation needed for these changes?

None

> $ npm run build                                                                                     ⬡ 20.17.0 [±NODE-6732 ●●]

> [email protected] build
> webpack --mode=production --node-env=production

asset ddd8623158585010a372d5db2a6fe99d.node 268 KiB [emitted] (auxiliary name: main)
asset main.js 4.79 KiB [emitted] [minimized] (name: main)
runtime modules 150 bytes 2 modules
cacheable modules 15.9 KiB
  modules by path ./node_modules/kerberos/lib/ 14.2 KiB
    ./node_modules/kerberos/lib/index.js 419 bytes [built] [code generated]
    ./node_modules/kerberos/lib/kerberos.js 7.51 KiB [built] [code generated]
    ./node_modules/kerberos/lib/auth_processes/mongodb.js 3.65 KiB [built] [code generated]
    ./node_modules/kerberos/lib/util.js 2.59 KiB [built] [code generated]
  ./src/index.js 75 bytes [built] [code generated]
  ./node_modules/kerberos/package.json 1.48 KiB [built] [code generated]
  ./node_modules/kerberos/build/Release/kerberos.node 197 bytes [built] [code generated]
external "dns" 42 bytes [built] [code generated]
external "path" 42 bytes [optional] [built] [code generated]

WARNING in ./node_modules/kerberos/lib/util.js 91:13-52
Module not found: Error: Can't resolve '../build/Debug/kerberos.node' in '/Users/modetojoy/work/mongodb-js/kerberos/test/bundling/webpack/node_modules/kerberos/lib'
 @ ./node_modules/kerberos/lib/kerberos.js 3:42-59
 @ ./node_modules/kerberos/lib/index.js 3:17-38
 @ ./src/index.js 2:17-36

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.97.1 compiled with 1 warning in 255 ms

What is the motivation for this change?

NODE-6732

Release Highlight

Package is now compatible with Webpack

In order to use this module when bundling with Webpack, please include in your webpack.config.js:

  target: 'node',
  module: {
    rules: [
      {
        test: /\.node$/i,
        loader: 'node-loader'
      }
    ]
  }

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran changed the title Node 6732 fix(NODE-6732): test and fix webpack bundling Feb 10, 2025
@durran durran marked this pull request as ready for review February 10, 2025 19:51
@durran durran requested a review from a team as a code owner February 10, 2025 19:51
@baileympearson baileympearson self-assigned this Feb 10, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 10, 2025
@baileympearson baileympearson added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Feb 10, 2025
@baileympearson baileympearson merged commit 81bf1a7 into main Feb 10, 2025
18 checks passed
@baileympearson baileympearson deleted the NODE-6732 branch February 10, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants