@intellihr/rosaenlg-loader
v0.0.3
Published
Webpack Loader for RosaeNLG
Downloads
357
Readme
rosaenlg-loader
Webpack loader for RosaeNLG (https://rosaenlg.org/)
Getting Started
To begin, you'll need to install rosaenlg-loader
:
$ npm install rosaenlg-loader --save-dev
Then add the loader to your webpack
config. For example:
file.pug
import file from 'file.pug';
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.pug$/,
use: [
{
loader: `rosaenlg-loader`,
options: {
language: ['en_US']
},
},
],
},
],
},
};
And run webpack
via your preferred method.
Options
language
Type: string|array
Target languages for compilation, e.g. en_US
, fr_FR
Examples
[ example outline text ]
webpack.config.js
{
test: /\.pug$/,
use: [
{
loader: `rosaenlg-loader`,
options: {
language: ['en_US']
},
},
],
}
file.pug
| example translation
file.js
import rosaenlg from 'rosaenlg/dist/rollup/rosaenlg_tiny_en_US_3.0.0';
import template from 'file.pug';
const text = template.en_US({
util: new rosaenlg.NlgLib({ language: 'en_US' })
})
Contributing
Please take a moment to read our contributing guidelines if you haven't yet done so.