我从Kendo(kendo.culture.en-US-Custom.min.js)修改了一个文化设置文件,并且能够缩小它。但我不知道如何创建针对它的.map。我的网络日志显示针对该文件的404。地图文件有生成器吗?这是文件:
!function (e) { "function" == typeof define && define.amd ? define(["kendo.core.min"], e) : e() }(function () {
!function (e, y) {
kendo.cultures["en-US"] = {
name: "en-US", numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n %", "n %"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
name: "UAE Dirham",
abbr: "AED",
pattern: ["-n $", "n $"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "د.إ."
}
},
calendars: {
standard: {
days: {
names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
},
months: {
names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
AM: ["AM", "am", "AM"],
PM: ["PM", "pm", "PM"],
patterns: {
d: "dd-MMM-yyyy",
D: "dddd, MMMM dd, yyyy",
F: "dddd, MMMM dd, yyyy h:mm:ss tt",
g: "dd-MMM-yyyy h:mm tt",
G: "dd-MMM-yyyy h:mm:ss tt",
m: "MMMM d",
M: "MMMM d",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "h:mm tt",
T: "h:mm:ss tt",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM, yyyy", Y: "MMMM, yyyy"
},
"/": "/",
":": ":",
firstDay: 0
}
}
}
}(this)
});
感谢。
答案 0 :(得分:1)
要创建javascript源代码的最小化版本,您可以使用以下选项之一。
命令行uglifi-js :
安装:
npm install uglify-js -g
运行命令创建最小化文件和地图:
uglifyjs kendo.culture.en-US-Custom.js
--source-map kendo.culture.en-US-Custom.min.js.map
-o kendo.culture.en-US-Custom.min.js
按照此link
的说明操作Grunt Uglify:
您可以使用Grunt.js uglify:
安装:
npm install grunt-contrib-uglify --save-dev
Gruntfile.js中的代码:
grunt.initConfig({
uglify: {
my_target: {
options: {
sourceMap: true // this line is for create the map
},
files: {
'kendo.culture.en-US-Custom.min.js': ['kendo.culture.en-US-Custom.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
运行" uglify任务"将创建文件和地图的最小化版本。
按照此link
的说明操作Gulp Uglify:
或者你可以用" Gulp Uglify"。
做类似的事情按照此link
的说明操作