This repository has been archived by the owner on Jul 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to change locale globally
- Loading branch information
Showing
7 changed files
with
122 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
import { Config } from 'bili' | ||
import { Config } from "bili"; | ||
|
||
const config: Config = { | ||
input: 'src/index.js', | ||
input: "src/index.js", | ||
output: { | ||
moduleName: 'VueTimeago', | ||
format: ['esm', 'umd', 'cjs'], | ||
moduleName: "VueTimeago", | ||
format: ["esm", "umd", "cjs"], | ||
fileName({ format }, defaultFileName) { | ||
if (format === 'cjs') { | ||
return 'vue-timeago.cjs.js' | ||
if (format === "cjs") { | ||
return "vue-timeago.cjs.js"; | ||
} | ||
if (format === 'umd') { | ||
return 'vue-timeago.js' | ||
if (format === "umd") { | ||
return "vue-timeago.js"; | ||
} | ||
if (format === 'esm') { | ||
return 'vue-timeago.es.js' | ||
if (format === "esm") { | ||
return "vue-timeago.es.js"; | ||
} | ||
return defaultFileName | ||
return defaultFileName; | ||
} | ||
}, | ||
babel: { | ||
minimal: true | ||
}, | ||
extendConfig(config, { format }) { | ||
if (format === 'umd') { | ||
config.output.minify = true | ||
if (format === "umd") { | ||
config.output.minify = true; | ||
config.env = Object.assign({}, config.env, { | ||
NODE_ENV: "production" | ||
}); | ||
} | ||
return config | ||
return config; | ||
} | ||
} | ||
}; | ||
|
||
export default config | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ r.keys().forEach(v => { | |
}) | ||
|
||
Vue.use(Timeago, { | ||
locale: 'en', | ||
locales, | ||
converter | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters