-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Add these to webpack rules, install noflo-component-loader coffee-loader fbp-loader
{
test: /noflo(\\+|\/)lib(\\+|\/)loader(\\+|\/)register.js$/,
use: [
{
loader: 'noflo-component-loader',
options: {
// Only include components used by this graph
// Set to NULL if you want all installed components
graph: null,
// Whether to include the original component sources
// in the build
debug: true,
baseDir: __dirname,
manifest: {
runtimes: ['noflo'],
discover: true,
recursive: true,
},
runtimes: [
'noflo',
'noflo-browser',
],
},
},
],
},
{
test: /\.coffee$/,
// load noflo-interaction standard lib, which provide some component in this format
use: ['coffee-loader'],
},
{
test: /\.fbp$/,
// load noflo-strings standard lib, which provide some component in this format
use: ['fbp-loader'],
},This shows how this loader use fbp-manifest package, don't forget the recursive: true, otherwise you will get nothing.
// try.mjs
import fbpManifest from 'fbp-manifest';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const baseDir = path.resolve(__dirname, '../');
const components = await fbpManifest.load.load(baseDir, {
runtimes: ['noflo'],
discover: true,
recursive: true,
});
// DEBUG: console components
console.log(`components`, components.modules[3]);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels