1.1.0 • Published 8 months ago

@bithero/monaco-glsl v1.1.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
-
Last release
8 months ago

glsl-monaco

Npm package version

An plugin to add a language definition for glsl to the monaco-editor.

license

This project is licensed under GPL-3.0. See the LICENSE file for more informations.

usage

Simply import it:

import '@bithero/monaco-glsl';

browsers

Inside browsers the usage is slightly different:

For AMD builds (min/dev):

require.config({
    paths: {
        vs: '...',      // configure the vs path like always
        bithero: '...'  // set to the web-path where the glsl.js file lies in
    }
});
require(['vs/editor/editor.main'], function() {
    // require it async; literally any other way will fail!
    require(['bithero/glsl'], function() {});

    // you can also setup a monaco instance via monaco.editor.create here;
    // but if you want it safer, do it inside the callback of the glsl require...
});