Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function( grunt ) {
var fs = require( "fs" ),
requirejs = require( "requirejs" ),
srcFolder = __dirname + "/../../src/",
rdefineEnd = /\}\);[^}\w]*$/,
rdefineEnd = /\}\s*?\);[^}\w]*$/,
Copy link
Member

Choose a reason for hiding this comment

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

A very minor nit: the non-greediness doesn't matter here as \) doesn't match \s anyway, other regexps in this file don't use it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I generally use non-greedy unless I explicitly want greediness.

Copy link
Member

Choose a reason for hiding this comment

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

OK, doesn't matter.

config = {
baseUrl: "src",
name: "jquery",
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = function( grunt ) {
} else {

contents = contents
.replace( /\s*return\s+[^\}]+(\}\);[^\w\}]*)$/, "$1" )
.replace( /\s*return\s+[^\}]+(\}\s*?\);[^\w\}]*)$/, "$1" )
// Multiple exports
.replace( /\s*exports\.\w+\s*=\s*\w+;/g, "" );

Expand Down