frau-appconfig-webpack-plugin
v0.0.3
Published
Webpack plugin for frau-appconfig-builder
Downloads
5
Readme
frau-appconfig-webpack-plugin
Webpack plugin that builds app config using frau-appconfig-builder
Installation
Install from npm:
npm install frau-appconfig-webpack-plugin
or
yarn install frau-appconfig-webpack-plugin
Usage
import FrauAppConfigPlugin from 'frau-appconfig-webpack-plugin';
//Webpack config
const config = {
...,
plugins: [
new FrauAppConfigPlugin(options)
]
Options
There are two ways to specifiy options:
- Pass in an object with the follow properties defined. appId, description, version, appClass and appFile must be defined
{
appId: 'urn:d2l:fra:id:sample',
description: 'test-config',
version: '1.0.0',
frauAppConfigBuilder: {
appFile: 'index.html',
dist: './test',
envVar: 'TRAVIS',
loader: 'iframe'
} ,
frauLocalAppResolver: {
appClass: 'urn:d2l:fra:class:sample'
},
frauPublisher: {
files: './dist/**',
moduleType: 'app',
targetDirectory: 'sample',
creds: {
key: 'key',
secret: 'S3_SECRET'
},
devTagVar: 'TRAVIS_COMMIT', or devTag: 'Custom dev Tag'
versionVar: 'TRAVIS_TAG' or version: 'SEMVAR VERSION: Ex. 1.0.0'
}
}
- Pass in path to
package.json
and define the options in the file. Example shown below.
{
packageFile: 'PATH_TO_PACKAGE_JSON'
}
{
"name": "sample-package-json",
"appId": "urn:d2l:fra:id:sample",
"version": "0.0.1",
"description": "Sample package json",
"config": {
"frauAppConfigBuilder": {
"appFile": "index.html",
"dist": "./dist",
"envVar": "TRAVIS",
"loader": "iframe"
},
"frauLocalAppResolver": {
"appClass": "urn:d2l:fra:class:sample"
},
"frauPublisher": {
"files": "./dist/**",
"moduleType": "app",
"targetDirectory": "sample",
"creds": {
"key": "key",
"secret": "S3_SECRET"
},
"devTag": "TRAVIS_COMMIT",
"version": "TRAVIS_TAG"
}
}
}
Contributing
Fork the repository. Committing directly against this repository is highly discouraged.
Make your modifications in a branch, updating and writing new unit tests as necessary in the
spec
directory.Ensure that all tests pass with
yarn test
Submit a pull request to this repository. Wait for tests to run and someone to chime in.
Code Style
This repository is configured with EditorConfig rules.