美文网首页
vue.config.js-moment去除多余语言环境

vue.config.js-moment去除多余语言环境

作者: JsPatric | 来源:发表于2020-08-26 11:33 被阅读0次

const MomentLocalesPlugin = require('moment-locales-webpack-plugin')

module.exports= {

    configureWebpack:{

        plugins: [

             // 剥离除 “en” 以外的所有语言环境。

            new MomentLocalesPlugin(),

             // 或者:剥离除 “en”、“es-us” 和 “ru” 以外的所有语言环境。 

            //(“en” 内置于 Moment 中,无法移除) 

            new MomentLocalesPlugin({

                localesToKeep: ['es-us', 'ru']

            })

        ]

     },

}


注:需安装moment &  moment-locales-webpack-plugin

npm i -S moment

npm i -D moment-locales-webpack-plugin

相关文章

网友评论

      本文标题:vue.config.js-moment去除多余语言环境

      本文链接:https://www.haomeiwen.com/subject/kfuxsktx.html