diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/fixtures/README.md | 2 | ||||
-rw-r--r-- | build/release/dist.js | 2 | ||||
-rw-r--r-- | build/tasks/node_smoke_tests.js | 30 |
3 files changed, 30 insertions, 4 deletions
diff --git a/build/fixtures/README.md b/build/fixtures/README.md index 9e9bf7169..2511a51c3 100644 --- a/build/fixtures/README.md +++ b/build/fixtures/README.md @@ -120,6 +120,8 @@ If you need to use jQuery in a file that's not an ECMAScript module, you can use const $ = require( "jquery" ); ``` +The CommonJS module _does not_ expose named `$` & `jQuery` exports. + #### Individual modules jQuery is authored in ECMAScript modules; it's also possible to use them directly. They are contained in the `src/` folder; inspect the package contents to see what's there. Full file names are required, including the `.js` extension. diff --git a/build/release/dist.js b/build/release/dist.js index e71dd3b4d..78dc5064f 100644 --- a/build/release/dist.js +++ b/build/release/dist.js @@ -17,6 +17,8 @@ module.exports = function( Release, files, complete ) { "LICENSE.txt", "AUTHORS.txt", "dist/package.json", + "dist/jquery.bundler-require-wrapper.js", + "dist/jquery.bundler-require-wrapper.slim.js", "dist-module/package.json", "dist-module/jquery.node-module-wrapper.js", "dist-module/jquery.node-module-wrapper.slim.js" diff --git a/build/tasks/node_smoke_tests.js b/build/tasks/node_smoke_tests.js index 6f99b9981..7d6588648 100644 --- a/build/tasks/node_smoke_tests.js +++ b/build/tasks/node_smoke_tests.js @@ -5,8 +5,8 @@ const util = require( "node:util" ); const exec = util.promisify( require( "node:child_process" ).exec ); const verifyNodeVersion = require( "./lib/verifyNodeVersion" ); -const allowedLibraryTypes = [ "regular", "factory" ]; -const allowedSourceTypes = [ "commonjs", "module" ]; +const allowedLibraryTypes = new Set( [ "regular", "factory" ] ); +const allowedSourceTypes = new Set( [ "commonjs", "module", "dual" ] ); if ( !verifyNodeVersion() ) { return; @@ -19,8 +19,8 @@ if ( !verifyNodeVersion() ) { // each other, e.g. so that they don't share the `require` cache. async function runTests( { libraryType, sourceType, module } ) { - if ( !allowedLibraryTypes.includes( libraryType ) || - !allowedSourceTypes.includes( sourceType ) ) { + if ( !allowedLibraryTypes.has( libraryType ) || + !allowedSourceTypes.has( sourceType ) ) { throw new Error( `Incorrect libraryType or sourceType value; passed: ${ libraryType } ${ sourceType } "${ module }"` ); @@ -127,6 +127,28 @@ async function runDefaultTests() { libraryType: "factory", sourceType: "module", module: "./dist-module/jquery.factory.slim.module.js" + } ), + + runTests( { + libraryType: "regular", + sourceType: "dual", + module: "jquery" + } ), + runTests( { + libraryType: "regular", + sourceType: "dual", + module: "jquery/slim" + } ), + + runTests( { + libraryType: "factory", + sourceType: "dual", + module: "jquery/factory" + } ), + runTests( { + libraryType: "factory", + sourceType: "dual", + module: "jquery/factory-slim" } ) ] ); } |