diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-06-27 18:23:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 18:23:58 +0200 |
commit | 5701957b7223659c52a43f8c2c5465fdf2803df4 (patch) | |
tree | 2a33cd8a8796928db6ed26cf7237ef3b32b2d84c /build/tasks/amd.js | |
parent | 62b9a2583460c2384f6de1d0a6aeaf05e51d523b (diff) | |
download | jquery-5701957b7223659c52a43f8c2c5465fdf2803df4.tar.gz jquery-5701957b7223659c52a43f8c2c5465fdf2803df4.zip |
Build: Drop individual AMD modules
With this change, jQuery build no longer generates the `amd` directory with
AMD modules transpiled from source `src` ECMAScript Modules. To use individual
jQuery modules from source, ESM is now required.
Note that this DOES NOT affect the main `"jquery"` AMD module defined by built
jQuery files; those remain supported.
Closes gh-5276
Diffstat (limited to 'build/tasks/amd.js')
-rw-r--r-- | build/tasks/amd.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/build/tasks/amd.js b/build/tasks/amd.js deleted file mode 100644 index c4c9c8941..000000000 --- a/build/tasks/amd.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Compiles sources from ES Modules in `src/` to AMD in `amd/`. - */ - -"use strict"; - -module.exports = function( grunt ) { - const path = require( "path" ); - const rimraf = require( "rimraf" ); - const rollup = require( "rollup" ); - const srcFolder = path.resolve( __dirname, "..", "..", "src" ); - const amdFolder = path.resolve( srcFolder, "..", "amd" ); - const inputFileName = "jquery.js"; - - const inputRollupOptions = { - input: path.resolve( srcFolder, inputFileName ), - preserveModules: true - }; - - const outputRollupOptions = { - format: "amd", - dir: "amd", - indent: false - }; - - grunt.registerTask( - "amd", - "Convert ES modules from `src/` to AMD modules in `amd/`", - async function() { - const done = this.async(); - - try { - grunt.verbose.writeln( "Removing the 'amd' directory..." ); - rimraf( amdFolder, async function() { - const bundle = await rollup.rollup( inputRollupOptions ); - await bundle.write( outputRollupOptions ); - grunt.log.ok( "Sources from 'src' converted to AMD in 'amd'." ); - done(); - } ); - } catch ( err ) { - done( err ); - } - } ); -}; |