mirror of https://github.com/abpframework/abp.git
5 changed files with 61 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.Extensions.Options; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Moment; |
||||
|
|
||||
|
public class MomentScriptContributor : BundleContributor |
||||
|
{ |
||||
|
public const string PackageName = "moment"; |
||||
|
|
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains("/libs/moment/moment.js"); |
||||
|
} |
||||
|
|
||||
|
public override void ConfigureDynamicResources(BundleConfigurationContext context) |
||||
|
{ |
||||
|
var fileName = context.LazyServiceProvider.LazyGetRequiredService<IOptions<AbpLocalizationOptions>>().Value.GetCurrentUICultureLanguageFilesMap(PackageName); |
||||
|
var filePath = $"/libs/moment/locale/{fileName}.js"; |
||||
|
if (context.FileProvider.GetFileInfo(filePath).Exists) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains(filePath); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
module.exports = { |
||||
|
mappings: { |
||||
|
"@node_modules/moment/moment.js": "@libs/moment/", |
||||
|
"@node_modules/moment/locale/*.*": "@libs/moment/locale/", |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
{ |
||||
|
"version": "6.0.0-rc.3", |
||||
|
"name": "@abp/moment", |
||||
|
"repository": { |
||||
|
"type": "git", |
||||
|
"url": "https://github.com/abpframework/abp.git", |
||||
|
"directory": "npm/packs/moment" |
||||
|
}, |
||||
|
"publishConfig": { |
||||
|
"access": "public" |
||||
|
}, |
||||
|
"dependencies": { |
||||
|
"moment": "^2.9.0" |
||||
|
}, |
||||
|
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" |
||||
|
} |
||||
Loading…
Reference in new issue