Skip to content

Commit dc2d711

Browse files
committed
do path resolution on the filename rather than the inlined shader string
1 parent 2c80760 commit dc2d711

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A [babel](https://babeljs.io/) transform for [glslify](https://github.com/stackg
66
This module works the same as the browserify transform in [glslify](https://github.com/stackgl/glslify), except that it is compatible with babel. It also supports ES6 syntax and some more advanced features like tagged strings. For example, you can write something like this,
77

88
```javascript
9-
import glsl from glslify;
9+
import glsl from "glslify";
1010

1111
const myFragShader = glsl`
1212
#pragma glslify: noise = require(glsl-noise/simplex/2d)

lib/glslify-sync-hack.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ module.exports = function (baseDir, stringInput, optionInput) {
1515
}
1616

1717
if (optionInput.inline) {
18-
glslifyInput.data = path.resolve(stringInput)
18+
glslifyInput.data = stringInput
1919
} else {
20-
glslifyInput.filename = stringInput
20+
glslifyInput.filename = path.resolve(stringInput)
2121
}
2222

2323
var options = {

0 commit comments

Comments
 (0)