gingerhendrix / broccoli-browserify Goto Github PK
View Code? Open in Web Editor NEWBrowserify plugin for Broccoli
Browserify plugin for Broccoli
Thanks for making this plugin, it's really useful.
We're using it with a fairly complex app, and it takes several seconds for browserify to do its thing. With watchify that wouldn't be a problem, because with each change, only the updated files get reparsed. But with broccoli, the write()
function is called whenever the input tree is modified, and the whole tree has to be parsed and bundled, making the feedback loop too slow.
Given broccoli's architecture and stated objectives it seems as though there ought to be a way to do incremental rebundles, similar to watchify. But it's not obvious how to go about it. Before I spend the next few days tearing my hair out, I thought I'd raise the issue here and see if you'd had any thoughts about how that might work?
Would be great to have right in the options :)
can probably steal from grunt-broccoli to make it happen.
Upgrade Browserify to new version, and hence allow SourceMaps when you pass {browserify: { debug: true }}
option to the transform.
Hello,
I can not figure out how to set a directory as entry point. I would like to browserify all files inside that directory. Is it possible?
I can't get a standalone output to work properly. Using the cli i get the proper output, but not with this.
var myTree = browserify('lib', {
entries: ['./retriable-promise.js'],
browserify: {
standalone: 'retriablePromise'
}
});
does not output the same as running
browserify lib/retriable-promise.js --standalone retriablePromise
anyone have any insight as to why that is?
I get very cryptic unhelpful errors when I try to use this.
My extremely simple Brocfile.js is:
module.exports = function (broccoli) {
var browserify = require('broccoli-browserify')
, sourceTree = broccoli.makeTree('src')
sourceTree = browserify(sourceTree, {entries: 'client.js'})
return sourceTree
}
And the errors I get are:
Error: Cannot find module 'c' from 'src'
at /Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:44:17
at process (/Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:110:43)
at /Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:119:21
at load (/Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:54:43)
at /Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:60:22
at /Users/chris/Sites/room.js.new/client/node_modules/broccoli-browserify/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:97:15)
The odd and cryptic part of it is that the "module" letter (in this case c
) is sometimes different, and the "from" part is always the name as the sourceTree directory name. Am I just using this wrong?
Hello, this project doesn't appear to be maintained any longer. I would like to offer adopting the project. I have just released broccoli-watchify 1.0.0 which addresses most (or all) of the open issues for this project. What is is lacking, is the canonical and easy to find name broccoli-browserify
.
Anyways, I would love to merge these projects, given all the original authors the attribution they deserve, but give our users a single easy to find node_module "that just works".
similar request just opened at broccoli-fast-browserify caleb/broccoli-fast-browserify#23
Let me know.
I get an error TypeError: Arguments to path.join must be strings
when I try and build simple bundle.
Here is my current Brocfile.js
var compileBrowserifyBundles = require('broccoli-browserify');
var pickFiles = require('broccoli-static-compiler');
var browserifyAssets = 'assets/jsBundles'
browserifyAssetsTree = pickFiles(browserifyAssets, {
srcDir: '/',
files: ['**/*.js'],
destDir: 'jsBundles/' // All files are served from "jsBundles/"?
});
// Process changes
browserifyAppJs = compileBrowserifyBundles(browserifyAssetsTree, {
entries: ['./jsBundles/bundleJs.js']
});
return browserifyAppJs;
Here is the error stack
tmp/static_compiler-tmp_dest_dir-S8uJchOO.tmp { basedir: 'tmp/static_compiler-tmp_dest_dir-S8uJchOO.tmp' }
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at /Users/rob.munro/git/test/node_modules/broccoli-browserify/lib/index.js:40:29
at /Users/rob.munro/git/test/node_modules/browserify/index.js:299:22
at /Users/rob.munro/git/test/node_modules/browserify/index.js:299:22
at /Users/rob.munro/git/test/node_modules/browserify/index.js:327:13
at ConcatStream.<anonymous> (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/index.js:32:43)
at ConcatStream.EventEmitter.emit (events.js:92:17)
at finishMaybe (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:450:14)
at afterWrite (/Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:330:3)
at /Users/rob.munro/git/test/node_modules/browserify/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:317:9
at process._tickCallback (node.js:415:13)
Would be great if i could just specify a broccoli tree and browserify all files in specific directory (similar to the broccoli-coffeescript module)
eg.
var filterCoffeeScript = require('broccoli-coffee');
var compileBrowserifyBundles = require('broccoli-browserify');
var pickFiles = require('broccoli-static-compiler');
// Build up coffee assets tree for browserify
var browserifyAssets = 'assets/jsBundles'
browserifyAssetsTree = pickFiles(browserifyAssets, {
srcDir: '/',
files: ['**/*.coffee'],
destDir: 'jsBundles/' // All files are served from "jsBundles/"?
});
// Convert those coffee assets into js
browserifyAssetsTree = filterCoffeeScript(browserifyAssetsTree, {
bare: false
});
// Build all js files in particular directory
browserifyAppJs = compileBrowserifyBundles(browserifyAssetsTree, {
dir: 'jsBundles/'
outputDir: 'js/
});
return browserifyAppJs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.