mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Add uppy.js to build and project (#13645)
This PR adds uppy to the project with a custom JS build and the shims needed to import it into our JS code. We need a custom build of Uppy because we do not use webpack for our JS modules/build. The only way to get what you want from Uppy is to use the webpack modules or to include the entire Uppy project including all plugins in a single JS file. This way we can just use the plugins we actually want. Future PRs will actually use Uppy!
This commit is contained in:
@ -217,7 +217,10 @@ def dependencies
|
||||
public: true,
|
||||
skip_versioning: true
|
||||
},
|
||||
|
||||
{
|
||||
source: 'custom-uppy-build.js',
|
||||
destination: 'uppy.js'
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
@ -339,7 +342,14 @@ task 'javascript:update' => 'clean_up' do
|
||||
# lodash.js needs building
|
||||
if src.include? "lodash.js"
|
||||
puts "Building custom lodash.js build"
|
||||
system('yarn run lodash include="each,filter,map,range,first,isEmpty,chain,extend,every,omit,merge,union,sortBy,uniq,intersection,reject,compact,reduce,debounce,throttle,values,pick,keys,flatten,min,max,isArray,delay,isString,isEqual,without,invoke,clone,findIndex,find,groupBy" minus="template" -d -o "node_modules/lodash.js"')
|
||||
system('yarn run lodash include="escapeRegExp,each,filter,map,range,first,isEmpty,chain,extend,every,omit,merge,union,sortBy,uniq,intersection,reject,compact,reduce,debounce,throttle,values,pick,keys,flatten,min,max,isArray,delay,isString,isEqual,without,invoke,clone,findIndex,find,groupBy" minus="template" -d -o "node_modules/lodash.js"')
|
||||
end
|
||||
|
||||
# we need a custom build of uppy because we cannot import
|
||||
# their modules easily, using browserify to do so
|
||||
if src.include? "custom-uppy-build"
|
||||
puts "Building custom uppy using browserify"
|
||||
system("yarn run browserify #{vendor_js}/custom-uppy.js -o node_modules/custom-uppy-build.js")
|
||||
end
|
||||
|
||||
unless File.exists?(dest)
|
||||
|
Reference in New Issue
Block a user