Skip to content

Brightspace/frau-appconfig-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frau-appconfig-webpack-plugin

Webpack plugin that builds app config using frau-appconfig-builder

NPM version Build status Coverage Status Dependency Status

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:

  1. 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',
            secretVar: 'S3_SECRET', or secret: '{SECRET}'
        },
        devTagVar: 'TRAVIS_COMMIT', or devTag: 'Custom dev Tag'
        versionVar: 'TRAVIS_TAG' or version: 'SEMVAR VERSION: Ex. 1.0.0'
    }
}
  1. 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",
                "secretVar": "S3_SECRET", secret: '{SECRET}'
            },
            "devTagVar": "TRAVIS_COMMIT",
            "versionVar": "TRAVIS_TAG"
        }
    }
}

Contributing

  1. Fork the repository. Committing directly against this repository is highly discouraged.

    1. Make your modifications in a branch, updating and writing new unit tests as necessary in the spec directory.

      1. Ensure that all tests pass with yarn test

      2. 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.

About

Webpack plugin that builds app config using frau-appconfig-builder

Resources

Stars

Watchers

Forks

Packages

No packages published