Socket
Book a DemoInstallSign in
Socket

@plutotcool/rollup-plugin-glsl-bundler

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@plutotcool/rollup-plugin-glsl-bundler

Rollup plugin that allows imports of glsl files

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
3
Created
Source

rollup-plugin-glsl-bundler

Rollup plugin that allows imports of glsl files. Resolves import pragma and minifies glsl code using @plutotcool/glsl-bundler.

Install

yarn add rollup-plugin-glsl-bundler --dev
// rollup.config.js

import { glslBundler } from '@plutotcool/rollup-plugin-glsl-bundler'

export default {
  plugins: [
    glslBundler({ /* options */ })
  ]
}

Options

interface GLSLBundlerParameters {
  /**
   * Patterns of files that must be transformed by the plugin.
   * 
   * Default: /\.(?:glsl|frag|vert)$/
   */
  include?: (string | RegExp)[] | string | RegExp | null

  /**
   * Patterns of files that must not be transformed by the plugin.
   * 
   * Default: null
   */
  exclude?: (string | RegExp)[] | string | RegExp | null

  /**
   * Alternative custom filter function that determines if a file should be
   * transformed by the plugin. If specified, the include and exclude parameters
   * are ignored.
   * 
   * Default: filter function created from include and exclude parameters
   */
  filter?: (id: string) => boolean
  
  /**
   * Enable loader pragma
   *
   * Default: true
   */
  loader?: boolean

  /**
   * Enable minifier or specify custom minify parameters
   * Default: true
   */
  minifier?: boolean | {
    renameFunctions?: boolean
    renameVariables?: boolean
    renameDefines?: boolean
    renameStructs?: boolean
    trimComments?: boolean
    trimSpaces?: boolean
    trimZeros?: boolean
  }

  /**
   * Additional transform functions to apply to glsl code
   */
  transforms?: ((source: string) => Promise<string> | string)[]
}

FAQs

Package last updated on 15 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts