@americanexpress/one-app-locale-bundler
v6.6.0
Published
A command line interface(CLI) tool for bundling the locale files.
Downloads
152
Readme
@americanexpress/one-app-locale-bundler
A command line interface (CLI) tool for bundling a module's locale files for use within the One App ecosystem. This is used internally by
one-app-bundler
and itsbundle-module
script.
📖 Table of Contents
🤹 Usage
Add files and format them using either options shown below within your one app module.
- locale
- en-US
- links
- integration.json
- qa.json
- production.json
copy.json
or
- locale
- en-US.json
- es-ES.json
Installation
npm i -D @americanexpress/one-app-locale-bundler
There are two ways to use this:
1. Usage with a build script
Use bundle-module-locale
in your build script and one-app-locale-bundler
as a development dependency.
{
"scripts": {
"build": "bundle-module-locale"
},
"devDependencies": {
"@americanexpress/one-app-locale-bundler": "^2.3.0"
}
}
2. Invocation using a function
The other option is to require @americanexpress/one-app-locale-bundler
and invoke the function for bundling.
Within the package.json file.
{
"devDependencies": {
"@americanexpress/one-app-locale-bundler": "^2.3.0"
}
}
In your JS module.
const localeBundler = require('@americanexpress/one-app-locale-bundler');
localeBundler();
Once the npm script npm run build
is run or the function is invoked the locales are bundled and added to the build folders below. The json files contain
content for development
, qa
and production
environments.
- build
- 1.0.0
- en-us
- module-name.json
- integration.json
- qa.json