Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack support? #18

Open
lencioni opened this issue Jun 25, 2014 · 8 comments
Open

webpack support? #18

lencioni opened this issue Jun 25, 2014 · 8 comments

Comments

@lencioni
Copy link

I think this project looks really cool, but I'm using webpack for my bundling, not browserify. I'm wondering if you would be interested in adding webpack support?

http://webpack.github.io/
https://github.com/webpack/webpack

@Raynos
Copy link
Contributor

Raynos commented Jun 25, 2014

I floated the idea that it would be cool if disc just consumed the JSON stream output of browserify rather then browserify itself.

That way you can get webpack to output a JSON stream and it just works tm.

@hughsk
Copy link
Owner

hughsk commented Jun 25, 2014

Hey @lencioni, thanks, glad you like the project :)

It was just suggested yesterday we add AMD support too. I'm not likely to implement either of these myself, but if you're keen to see this happen you should send through a pull request and I'll be happy to include it!

@Raynos if I understand correctly that would mean we can't handle any transforms applied after a bundle's been browserified, e.g. getting stats after minification. Perhaps supporting both would be the best approach? Good news is the output is pretty close to what disc expects:

[
  {
    "id": "/Users/hughsk/src/github.com/hughsk/gl-context/node_modules/raf-component/index.js",
    "source": "/**\n * Expose `requestAnimationFrame()`.\n */\n\nexports = module.exports = window.requestAnimationFrame\n  || window.webkitRequestAnimationFrame\n  || window.mozRequestAnimationFrame\n  || window.oRequestAnimationFrame\n  || window.msRequestAnimationFrame\n  || fallback;\n\n/**\n * Fallback implementation.\n */\n\nvar prev = new Date().getTime();\nfunction fallback(fn) {\n  var curr = new Date().getTime();\n  var ms = Math.max(0, 16 - (curr - prev));\n  var req = setTimeout(fn, ms);\n  prev = curr;\n  return req;\n}\n\n/**\n * Cancel.\n */\n\nvar cancel = window.cancelAnimationFrame\n  || window.webkitCancelAnimationFrame\n  || window.mozCancelAnimationFrame\n  || window.oCancelAnimationFrame\n  || window.msCancelAnimationFrame\n  || window.clearTimeout;\n\nexports.cancel = function(id){\n  cancel.call(window, id);\n};\n",
    "deps": { },
    "entry": false
  },
  {
    "id": "/Users/hughsk/src/github.com/hughsk/gl-context/index.js",
    "source": "var raf = require('raf-component')\n\nmodule.exports = createContext\n\nfunction createContext(canvas, opts, render) {\n  if (typeof opts === 'function') {\n    render = opts\n    opts = {}\n  } else {\n    opts = opts || {}\n  }\n\n  var gl = (\n    canvas.getContext('webgl', opts) ||\n    canvas.getContext('webgl-experimental', opts)\n  )\n\n  if (!gl) {\n    throw new Error('Unable to initialize WebGL')\n  }\n\n  if (render) raf(tick)\n\n  return gl\n\n  function tick() {\n    render(gl)\n    raf(tick)\n  }\n}\n",
    "deps": {
      "raf-component": "/Users/hughsk/src/github.com/hughsk/gl-context/node_modules/raf-component/index.js"
    },
    "entry": true,
    "order": 0
  }
]

@Raynos
Copy link
Contributor

Raynos commented Jun 25, 2014

@hughsk

Perhaps supporting both would be the best approach

👍

@cowwoc
Copy link

cowwoc commented Jan 29, 2015

I'm also interested in webpack support.

@kyriacos
Copy link

👍 for webpack support

@landonwilkins
Copy link

it appears thomsbg has hacked together some initial webpack support

https://github.com/thomsbg/disc

@idris
Copy link

idris commented Oct 2, 2015

👍 is anyone working on this? The @thomsbg fork didn't quite work for me

@hawkrives
Copy link

I just found https://chrisbateman.github.io/webpack-visualizer/, which is similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants