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.
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
npm i -D @americanexpress/one-app-locale-bundler
There are two ways to use this:
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"
}
}
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