Giter VIP home page Giter VIP logo

Comments (11)

mattdesl avatar mattdesl commented on August 15, 2024

Can you try budo@next and garnish@latest?

Here is a test case with the latest dependencies and it seems to be working:
https://github.com/mattdesl/three-glslify-example

Might be something with budo@4.

from budo.

mikkoh avatar mikkoh commented on August 15, 2024

Made sure I was on latest for all. Seems to be fine now.

from budo.

tomek-he-him avatar tomek-he-him commented on August 15, 2024

@mattdesl @mikkoh Is there a similar solution for non-glsl files?

I need to watch a plain old fs.readFileSync('…') – or (as I did with webpack and isomorphic-ensure) require('raw!…').

from budo.

tomek-he-him avatar tomek-he-him commented on August 15, 2024

BTW, I’ve just stumbled upon a way to do this programmatically: #59 (comment). But is there a way to get that with the CLI alone – or with a browserify transform?

from budo.

mattdesl avatar mattdesl commented on August 15, 2024

When you use brfs it should pick up non-JS dependencies.

Example:

index.js

var fs = require('fs')
var file = fs.readFileSync(__dirname + '/foo.txt', 'utf8')
console.log(file)
budo index.js --live -- -t brfs | garnish

Now when you save foo.txt it will cause a re-bundle and LiveReload.

from budo.

tomek-he-him avatar tomek-he-him commented on August 15, 2024

Great! Thanks!

from budo.

jon-grangien avatar jon-grangien commented on August 15, 2024

Any change anyone of you have tried this in 2017 with all recent versions? I try everything and cannot get glsl files to trigger bundle updates.

from budo.

mattdesl avatar mattdesl commented on August 15, 2024

Are you using brfs or glslify? Have you updated to latest versions of the transform? I'm using this on a current project so unless something else is going on it should be all good. 😄

from budo.

jon-grangien avatar jon-grangien commented on August 15, 2024

Hi! Glslify 6.0.1, is that what you're referring to? Yes, and the latest versions of budo and garnish. Your project doesn't happen to be open source, right?

It doesn't rebuild the bundle. Adding glsl files to watchGlob doesn't work as a reload is triggered without updating the bundle.

I had success with webpack and the glsl-loader, but I would enjoy using budo as it is faster.

from budo.

mattdesl avatar mattdesl commented on August 15, 2024

I updated the package.json in this example and you can see how to set it up with the latest version of the tools (you no longer need garnish, the repo was quite old).

https://github.com/mattdesl/three-glslify-example

If you clone and npm install + npm start in that repo it should work. If it's not working, it could be something to do with the LiveReload backend (which I'm sure we can also fix). 😄

from budo.

jon-grangien avatar jon-grangien commented on August 15, 2024

Thank you, I was updated but I removed a bunch of excess stuff I probably didn't need, and I would guess I was using the glslify transform the wrong way. Using it only like in the package.json in your repo and it works. Thanks a lot, and great work.

diff --git a/.babelrc b/.babelrc
index 3246af1..c13c5f6 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,4 +1,3 @@
 {
-  "plugins": ["glslify"],
-  "presets": ["es2015", "stage-0"]
+  "presets": ["es2015"]
 }
diff --git a/package.json b/package.json
index bae3f55..db8ad59 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
     "test": "echo \"Error: no test specified\" && exit 1",
     "build": "webpack -p",
     "serve": "node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --colors --config ./webpack.config.dev.js",
-    "serve:budo": "node_modules/.bin/budo src/main.js:public/bundle.js --live -v -p 8080 -t glslify | garnish",
+    "serve:budo": "node_modules/.bin/budo src/main.js:public/bundle.js --live -v -p 8080",
     "build:browserify": "browserify src/main.js | uglifyjs -m -c warnings=false > public/bundle.js"
   },
   "keywords": [
@@ -20,31 +20,24 @@
   "author": "Jonathan Grangien",
   "license": "ISC",
   "dependencies": {
-    "babel-core": "^6.18.2",
     "babel-loader": "^6.2.9",
     "babel-plugin-glslify": "^2.0.0",
     "babel-polyfill": "^6.16.0",
-    "babel-preset-es2015": "^6.18.0",
-    "babel-preset-stage-0": "^6.16.0",
+    "babel-preset-es2015": "^6.22.0",
     "babelify": "^7.3.0",
     "browserify": "^14.0.0",
     "budo": "^9.4.5",
     "css-loader": "^0.26.1",
-    "extract-text-webpack-plugin": "^1.0.1",
-    "garnish": "^5.2.0",
     "glsl-noise": "0.0.0",
     "glslify": "^6.0.1",
     "glslify-fancy-imports": "^1.0.1",
     "glslify-hex": "^2.1.1",
     "glslify-live": "^2.1.1",
-    "glslify-loader": "^1.0.2",
     "node-sass": "^3.13.0",
-    "raw-loader": "^0.5.1",
     "sass-loader": "^4.0.2",
     "style-loader": "^0.13.1",
-    "three": "^0.82.1",
+    "three": "^0.84.0",
     "three-trackballcontrols": "^0.0.5",
-    "transform-loader": "^0.2.3",
     "uglify-js": "^2.7.5",
     "webpack": "^1.14.0",
     "webpack-glsl-loader": "^1.0.1"

from budo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.