webpack module for F2 that generates app manifests

Usage no npm install needed!

<script type="module">
  import f2ManifestLoader from 'https://cdn.skypack.dev/f2-manifest-loader';


npm version Build Status Coverage Status

F2 Manifest Loader

This package enables the automatic generation of app manifests using F2 and webpack

  • Produces JS and JSON manifests
  • Scripts and styles automatically have a cachebuster appended


loaders: [
    // ...
        test: /\.jsx?/,
        loader: 'f2-manifest-loader',
        include: 'src/appclasses',
        options: {
            dest: path.join(__dirname, 'dist/manifests'),
            filename: 'manifest',
            appclass: path.join(
            styles: [path.join(
            commonScripts: ['http://my-cdn.com/bootstrap.js'],
            commonStyles: ['http://my-cdn.com/nice-styles.css'],
            inlineScripts: ['window.myObject = {hello: "world"}'],
            html: '<my-app class="my-class"></my-app>'


// dist/manifests/manifest.js
    "inlineScripts":[window.myObject = {hello: "world"}],
        "html":"<my-app class="my-class"></my-app>"


These options are available on top of the standard Webpack loader options:

  • dest: String (required, default: null) - path to destination folder for app manifests
  • filename: String - name of the generated manifest files. Default: <app_id>_manifest.js(on)
  • appclass: String (required, default: dist/[name].js) - path to the built appclass
  • styles: [String] - array of app styles to be included
  • commonScripts: [String] - array of common scripts to be included before the appclass
  • commonStyles: [String] - array of common styles to be included before app styles
  • inlineScripts: [String] - array of inline scripts to be included
  • html: String (default: <app-id /> lower-kebab-cased app id as declared in the appclass) - app HTML

Ignoring files

Include f2-manifest-loader-ignore (case sensitive) in a comment in any source file to have that file ignored by the loader.

// f2-manifest-loader-ignore

F2.Apps['com_open_f2_ignored_app'] = class app {
    constructor(appConfig, appContent, root) {
        this.appConfig = appConfig;
        this.appContent = appContent;
        this.root = root;

    init() {
        console.log('This app will not have its manifest generated');