mirror of https://github.com/abpframework/abp
parent
8e360a6aa4
commit
f6e7cbb13d
@ -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