glslify-bundle
Advanced tools
Comparing version 4.0.0 to 4.0.1
19
index.js
@@ -147,5 +147,18 @@ /*eslint-disable no-redeclare */ | ||
var importBindings = Object.keys(importMaps).map(function (name) { | ||
var x = importMaps[name] | ||
return [name, rename[x] || (x + suffix)] | ||
var importBindings = Object.keys(importMaps).map(function (id) { | ||
var value = importMaps[id] | ||
// floats/ints should not be renamed | ||
if (value.match(/^\d+(?:\.\d+?)?$/g)) { | ||
return [id, value] | ||
} | ||
// properties (uVec.x, ray.origin, ray.origin.xy etc.) should | ||
// have their host identifiers renamed | ||
var parent = value.match(/^([^\.]+)\.(.+)$/) | ||
if (parent) { | ||
return [id, (rename[parent[1]] || (parent[1] + suffix)) + '.' + parent[2]] | ||
} | ||
return [id, rename[value] || (value + suffix)] | ||
}) | ||
@@ -152,0 +165,0 @@ |
{ | ||
"name": "glslify-bundle", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Bundle a glslify-deps dependency tree into a GLSL source string", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
14141
20
248