mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Build: Followups after introducing ES modules compiled via Rollup
This commit cleans up a few comments & configurations that are out of date after the migration to ES modules backed by a Rollup-based compilation. Also, de-indent AMD modules. This will preserve a more similar structure to the one on 3.x-stable where the body of the main `define` wrapper is not indented. Closes gh-4705
This commit is contained in:
parent
297d18dd13
commit
55cd3a4436
@ -1,14 +1,5 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
|
|
||||||
"extends": "./.eslintrc-node.json",
|
"extends": "./.eslintrc-node.json"
|
||||||
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "rollup.config.js",
|
|
||||||
"parserOptions": {
|
|
||||||
"sourceType": "module"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ module.exports = function( grunt ) {
|
|||||||
grunt.initConfig( {
|
grunt.initConfig( {
|
||||||
pkg: grunt.file.readJSON( "package.json" ),
|
pkg: grunt.file.readJSON( "package.json" ),
|
||||||
dst: readOptionalJSON( "dist/.destination.json" ),
|
dst: readOptionalJSON( "dist/.destination.json" ),
|
||||||
"compare_size": {
|
compare_size: {
|
||||||
files: [ "dist/jquery.js", "dist/jquery.min.js" ],
|
files: [ "dist/jquery.js", "dist/jquery.min.js" ],
|
||||||
options: {
|
options: {
|
||||||
compress: {
|
compress: {
|
||||||
@ -232,7 +232,7 @@ module.exports = function( grunt ) {
|
|||||||
"test/data/jquery-1.9.1.js",
|
"test/data/jquery-1.9.1.js",
|
||||||
"test/data/testinit-jsdom.js",
|
"test/data/testinit-jsdom.js",
|
||||||
|
|
||||||
// We don't support various loading methods like AMD,
|
// We don't support various loading methods like esmodules,
|
||||||
// choosing a version etc. for jsdom.
|
// choosing a version etc. for jsdom.
|
||||||
"dist/jquery.js",
|
"dist/jquery.js",
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@ module.exports = function( grunt ) {
|
|||||||
|
|
||||||
const outputRollupOptions = {
|
const outputRollupOptions = {
|
||||||
format: "amd",
|
format: "amd",
|
||||||
dir: "amd"
|
dir: "amd",
|
||||||
|
indent: false
|
||||||
};
|
};
|
||||||
|
|
||||||
grunt.registerTask(
|
grunt.registerTask(
|
||||||
|
@ -54,7 +54,7 @@ module.exports = function( grunt ) {
|
|||||||
|
|
||||||
grunt.registerMultiTask(
|
grunt.registerMultiTask(
|
||||||
"build",
|
"build",
|
||||||
"Concatenate source, remove sub AMD definitions, " +
|
"Build jQuery ECMAScript modules, " +
|
||||||
"(include/exclude modules with +/- flags), embed date/version",
|
"(include/exclude modules with +/- flags), embed date/version",
|
||||||
async function() {
|
async function() {
|
||||||
const done = this.async();
|
const done = this.async();
|
||||||
@ -302,7 +302,7 @@ module.exports = function( grunt ) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
grunt.file.write( name, compiledContents );
|
grunt.file.write( name, compiledContents );
|
||||||
grunt.log.ok( "File '" + name + "' created." );
|
grunt.log.ok( `File '${ name }' created.` );
|
||||||
done();
|
done();
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
done( err );
|
done( err );
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
// Code Style. This makes that indentation check is not
|
// Code Style. This makes that indentation check is not
|
||||||
// performed for 1 depth of outer FunctionExpressions
|
// performed for 1 depth of outer FunctionExpressions
|
||||||
"ignoredNodes": [
|
"ignoredNodes": [
|
||||||
"Program > ExpressionStatement > CallExpression > FunctionExpression > *"
|
"Program > ExpressionStatement > CallExpression > :last-child > *"
|
||||||
]
|
]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
|
@ -576,7 +576,7 @@ jQuery.extend( {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We can fire global events as of now if asked to
|
// We can fire global events as of now if asked to
|
||||||
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
|
// Don't fire events if jQuery.event is undefined in an ESM-usage scenario (trac-15118)
|
||||||
fireGlobals = jQuery.event && s.global;
|
fireGlobals = jQuery.event && s.global;
|
||||||
|
|
||||||
// Watch for a new set of requests
|
// Watch for a new set of requests
|
||||||
|
Loading…
Reference in New Issue
Block a user