mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 18:31:26 +00:00
Merge pull request #2491 from overleaf/as-unvendor-moment
Unvendor moment from the frontend GitOrigin-RevId: 19ffc42a2d3e6eecfbec42575a0472f992c8abda
This commit is contained in:
parent
1a1a387301
commit
f2943054fb
5 changed files with 8 additions and 20 deletions
|
@ -6,7 +6,6 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const version = {
|
||||
moment: '2.9.0',
|
||||
ace: '1.4.5', // Upgrade instructions: https://github.com/overleaf/write_latex/wiki/Upgrading-Ace
|
||||
fineuploader: '5.15.4',
|
||||
algolia: '2.5.2'
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
define(['base', 'moment'], function(App, moment) {
|
||||
moment.locale('en', {
|
||||
moment.updateLocale('en', {
|
||||
calendar: {
|
||||
lastDay: '[Yesterday]',
|
||||
sameDay: '[Today]',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(['base', 'moment'], (App, moment) =>
|
||||
define(['base'], App =>
|
||||
App.controller('BinaryFileController', function(
|
||||
$scope,
|
||||
$rootScope,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -195,13 +195,8 @@ module.exports = {
|
|||
alias: {
|
||||
// Aliases for AMD modules
|
||||
|
||||
// Vendored dependencies in public/src/vendor/libs (e.g. angular)
|
||||
// Shortcut to vendored dependencies in frontend/js/vendor/libs
|
||||
libs: path.join(__dirname, 'frontend/js/vendor/libs'),
|
||||
// Use vendored moment (with correct version)
|
||||
moment: path.join(
|
||||
__dirname,
|
||||
`frontend/js/vendor/libs/${PackageVersions.lib('moment')}`
|
||||
),
|
||||
// Enables ace/ace shortcut
|
||||
ace: path.join(
|
||||
__dirname,
|
||||
|
@ -249,10 +244,11 @@ module.exports = {
|
|||
writeToFileEmit: true
|
||||
}),
|
||||
|
||||
// Silence warning when loading moment from vendored dependencies as it
|
||||
// attempts to load locales.js file which does not exist (but this is fine
|
||||
// as we don't want to load the large amount of locale data from moment)
|
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /frontend\/js\/vendor\/libs/),
|
||||
// Prevent moment from loading (very large) locale files that aren't used
|
||||
new webpack.IgnorePlugin({
|
||||
resourceRegExp: /^\.\/locale$/,
|
||||
contextRegExp: /moment$/
|
||||
}),
|
||||
|
||||
new CopyPlugin([
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue