Skip to main content

Output Options

These options configure the build output generated by chayns-toolkit build.

All options aswell as the toolkit.config.js file itself are optional.

/toolkit.config.js
module.exports = {    output: {        /**         * Toggles single-file build functionality. Read more below         *         * @type {boolean}         */        singleBundle: false,
        /**         * Change the file-name your of primary output bundle. You can use any         * of the [webpack substitutions](https://webpack.js.org/configuration/output/#template-strings)         * as well as the `[package]` substitution, which will be replaced by         * the package name specified in your `package.json`. Defaults to         * `[package].[contenthash].js`.         *         * @type {string}         */        filename: "[package].[contenthash].js",
        /**         * Set an absolute path where your output will be emitted to.         *         * @type {string}         */        path: "//my-qa-server/example-project",        /**         * Setting apiVersion to 5 enables features required for module federation         * @type undefined | 5         */        apiVersion: 5,        /**         * The exported entries used for module federation         * @type {{ [key: string]: string }}         */        exposeModules: {            "./AppWrapper": "./src/AppWrapper",        },        /**         * Enables build which targets server. Only relevant for federated modules which         * should be rendered by a server.         * @type {boolean}         */        serverSideRendering: false,    },    // ... other options ...}

Single File Builds#

In single-file build mode, the compiler will inline all assets (CSS, images, etc.) together with all JavaScript into a single bundle. This can be useful when building smaller fragments of a UI, e.g. some kind of plugin.