如果我使用 moment-with-locales ,我需要 momentJS 吗?

Akh*_*mar 2 javascript angularjs momentjs

现在我正在按以下顺序在我的项目中添加脚本:

window.top.ak.getScript([
    window.top.akContextPath + "/scripts/css/xxx.css",
    window.top.akContextPath + "/scripts/js/xxx.min.js",
    window.top.akContextPath + "/scripts/js/polyfills.min.js",
    window.top.akContextPath + "/scripts/js/jquery.min.js",
    currHost + "/components/lib/lodash.min.js",
    window.top.akContextPath + "/scripts/js/moment.min.js",
    window.top.akContextPath + "/scripts/js/angular.min.js"
], function() {
    window.top.ak.getScript([
        window.top.akContextPath + "/scripts/js/angular-messages.js",
        window.top.akContextPath + "/scripts/js/angular-ui-router.js",
        window.top.akContextPath + "/scripts/js/angular-animate.js",
        currHost + "/components/lib/toaster.min.js",
        window.top.akContextPath + "/scripts/js/ui-grid.min.js",
        currHost + "/components/lib/defiant.min.js",
        window.top.akContextPath + "/scripts/js/xxx-ui.js",
        currHost + "/components/lib/polyfill-resize.js",
        currHost + "/components/lib/draggable-rows.js",
        currHost + "/components/lib/moment-with-locales.js",
    ], function() {
        window.top.ak.getAsset([
            currHost + "/components/common.bundle.js",
            currHost + "/components/myApp." + pagePath + ".bundle.js"
        ], document);
    }, document);
}, document);
Run Code Online (Sandbox Code Playgroud)

其中getScript/getAsset方法将这些文件添加到 HTML。这工作得很好。

但检查后我很好奇moment.min.js如果我使用的话我是否需要moment-with-locales.js,对吗?

如果是的话,我可以把它放在哪里。还有其他库xxx.**.js使用它吗?

Jel*_*ema 5

Moment-with-locales.js 是添加了区域设置的时刻;-)。所以你不需要 moment-min.js。查看脚本列表,其他的似乎不需要momentjs。但话又说回来,momentjs 和 jQuery 一样基础,所以为什么不把它放在最上面呢?