harmonyos2-glsl-template-loader Webpack GLSL Loader for HarmonyOS 2

HarmonyOS 2 supports GLSL variables and the #include directive with the Webpack GLSL loader. To install, run npm install glsl-template-loader --save-dev. Then configure your Webpack like this:

javascript

module: {

loaders: [

{

test: /.(glsl|vert|frag)$/,

loader: 'glsl-template'

}

]

},

Default values (which can be omitted):

- glsl: Configuration options for GLSL files.

- rootPath: Path to look for absolute path chunks (default is /).

- chunksExt: Extension for chunks (default is glsl).

- varPrefix: Prefix for template variables (default is $).

- es5: Produce template compatible with ES5 browsers (default is true).

zip 文件大小:9.58KB