@flybywiresim/rollup-plugin-msfs

Rollup plugin for bundling Microsoft Flight Simulator HTML instruments

Usage no npm install needed!

<script type="module">
  import flybywiresimRollupPluginMsfs from 'https://cdn.skypack.dev/@flybywiresim/rollup-plugin-msfs';
</script>

README

Discord

GitHub latest release version Github All Releases download count GitHub contributors

About

Rollup plugin for bundling Microsoft Flight Simulator HTML instruments

Configuration

{
    name: string,                                       // Name of instrument (must be globally unique to all addons)
    elementName: string,                                // Name of custom element
    outputDir: string,                                  // Output directory for instrument files
    config: { index: string, isInteractive: boolean },  // Instrument configuration
    instrumentDir?: string,                             // Name of instrument ouptut directory (sub-directory of `outputDir`). Defaults to `name`
    jsBundle?: string,                                  // Name of JS rollup bundle. Defaults to bundle.js
    cssBundle?: string                                  // Name of CSS rollup bundle. Defaults to bundle.css
    imports?: string[],                                 // List of HTML/JS imports to add to the template HTML file. Defaults to none 
}

Example usage

const template = require('@flybywiresim/rollup-plugin-msfs');

    // other plugins ...
    template({
        name: 'MFD',
        elementName: 'a380x-mfd-element',
        config,
        imports: ['/JS/dataStorage.js'],
        outputDir: `${__dirname}/../../A380X/html_ui/Pages/VCockpit/Instruments/A380X`,
    }),
}