Libraries

With the useLibraries() utility you can import approved scripts and npm modules directly into your project. This provides a safe and consistent way to work with external dependencies.


Usage

First, include useLibraries in your module.exports function:

module.exports = ({ useLibraries }) => {
  // Your code here
};

Then, import the required library:

module.exports = ({ useLibraries }) => {
  const { Blockly } = useLibraries();

  // Example usage of Blockly
  const workspace = new Blockly.Workspace();
};

Notes

  • Only libraries explicitly approved or made available through useLibraries can be imported.

  • This ensures compatibility and prevents unsupported dependencies from being used.

Last updated