Build tool for Magnolia light modules

Usage no npm install needed!

<script type="module">
  import magnoliaMagnoliaBuild from 'https://cdn.skypack.dev/@magnolia/magnolia-build';


Magnolia build tools

This is a simple NPM tool meant to help with Magnolia light development. What it will do is scan a node_modules folder for Magnola light modules, and extract them to a directory of choice, light-modules by default. That way you can point your Magnolia instance's resource dir to that particular folder, and easily get started working on light modules. A Magnolia light module is an NPM package defined by the magnolia-light-module keyword in its package.json.


We recommend you install the module by using npm install --save-dev @magnolia/magnolia-build in your project. This way, it'll be both added to your package.json devDependencies and installed, in one command.

We then recommend you add the following script to your package.json:

"scripts": {
  "build": "magnolia-build"

This way, you can use npm run build.


The default output directory light-modules can be overriden by specifying an argument to the command in the following way:

magnolia-build [dist]

This module can also be used in scripts such as Gulp files.

var build = require('@magnolia/magnolia-build');
build('node_modules', 'light-modules');