Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

How about enabling cache options for Browserify? #5

Open
leehankyeol opened this issue Dec 6, 2016 · 1 comment
Open

How about enabling cache options for Browserify? #5

leehankyeol opened this issue Dec 6, 2016 · 1 comment

Comments

@leehankyeol
Copy link

leehankyeol commented Dec 6, 2016

After coding for a while, my bundle() started to take about 4-5 seconds, which is quite a lot when developing an app. So I googled around and found out I can actually enable cache options for Browserify.

In gulpfile.bable.js, I changed the following code (btw there're duplicated watchify.args.debug = true; in the code.)

// Input file.
watchify.args.debug = true;
var bundler = browserify('src/app.js', watchify.args);

into

// Input file.
var bundler = browserify({
  entries: ['src/app.js'],
  cache: {},
  packageCache: {},
  debug: true,
  plugin: [watchify],
});

and now bundling became much faster than before. Not really sure that what I've done makes sense so if there's anything wrong please let me know.

Always enjoying your courses and screencasts, thanks!

@xgqfrms-GitHub
Copy link

xgqfrms-GitHub commented Feb 5, 2017

??? Underscore ._getComments() error

Underscore helps distinguish custom methods from React methods

http://underscorejs.org/

how to import this lib & where ?

______________________________________________

const comments = this._getComments();

// Underscore

Underscore helps distinguish custom methods from React methods

New method that will return array of JSX elements

_getComments() {
    const commentList = [
        { id: 1, author: 'Morgan McCircuit', body: 'Great picture!' },
        { id: 2, author: 'Bending Bender', body: 'Excellent stuff' }
    ];
    return commentList.map(() => {
        return (<Comment />);
    });
}
______________________________________________

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

No branches or pull requests

2 participants