browserify

npm browserify version of jquery-select2 version 4.x

孤街醉人 提交于 2019-12-11 04:26:01
问题 I was wondering if : There is a browserif'ied version of jquery-select2 4.x plugin available via npm? If not, what do I need to do in order to get jquery-select2 4.x to work with my npm/browserify based project? I was looking at the source on github and it seems like there is a require/almond.js version available. Can the same version be used with browserify without any changes? I'm slightly confused as to what exactly am I required to do if I want to use jquery-select2 plugin with my project

Do es6 modules negate the need for browserify/webpack?

六眼飞鱼酱① 提交于 2019-12-11 03:35:02
问题 ES6 modules allow us to create modules of code that can be exported and imported as dependencies. Browserify and Webpack do the same thing. So am I right in assuming that if I use ES6 along with something like babel to transpile my code then webpack and browserify are not needed? 回答1: If you use it in the browser, you currently still need webpack or browserify. Let's have a look at an example: The following import * as name from 'name.js'; is turned into: 'use strict'; function

Browserify uglify via node script or command line?

一世执手 提交于 2019-12-11 03:17:49
问题 It seems in many places the professionals are building their projects using a node.js script that involves either gulp or grunt. What I can't figure out though, is why the script method is preferrable? When switching from the command line version to the script version, you add other packages in: i.e. gulp-uglify, vinyl-source-stream and vinyl-buffer. Wouldn't it be safer long-term-wise to use a method with the least amount of dependencies? Take for example the following command line method

Cannot read 'component' of undefined: Using material-ui with browserify

这一生的挚爱 提交于 2019-12-11 03:13:15
问题 I'm using browserify to manage my dependencies, as suggested on the material-ui setup doc. When I try to run my code, the console gives me this message: Uncaught TypeError: Cannot read property 'component' of undefined , which is traced back to bundle.js:6769 In my bundle.js file, line 6769 is the return statement of this function: getThemeButton: function getThemeButton() { return this.context.muiTheme.component.button; }, What am I missing here? I have require statements for both material

Running ReactJS.NET with browserify

大城市里の小女人 提交于 2019-12-11 03:08:27
问题 I'm struggling to get Browserify working with the ReactJS .NET MVC setup from the demo page. Everything works when rendering on the server with a .jsx file (not using require()), but when I use my Browserify bundle I get an error of: An exception of type 'React.Exceptions.ReactInvalidComponentException' occurred in React.dll but was not handled in user code. Additional information: Could not find a component named 'CommentBox'. Did you forget to add it to App_Start\ReactConfig.cs? Here is my

passing a default argument to a browserify module

☆樱花仙子☆ 提交于 2019-12-11 02:53:55
问题 I'm refactoring a javascript codebase and am implementing, but I'm new to node. I might run into some code like this: foo.js var foo = {}; foo.bar = function(baz) { $('body').append(baz) } which i would then refactor into the following: foo.js var $ = require('jquery')(window); var foo = {}; foo.bar = require('./bar'); bar.js module.exports = bar = function(baz) { $('body').append(baz); } What's the correct way to pass the jQuery object from foo.js to bar.js without interfering with the baz

karma-browserify throws error when trying to load modules shimmed with browserify-shim

て烟熏妆下的殇ゞ 提交于 2019-12-11 02:39:35
问题 I know there were similar questions but none of them solved my problem. When I run karma test it throws the following error, every time it tries to load a module, that was shimmed with browserify-shim: TypeError: 'undefined' is not an object (evaluating 'module.exports = ex') at /tmp/8ff1e03f7ba1f9c70ee4192510d267a2.browserify:3855:0 <- lib/underscore/underscore.js:1421:0 My karma.conf.js is the following: module.exports = function(karma) { karma.set({ frameworks: [ 'jasmine', 'browserify' ],

Can't get browserify to use babel-plugin-transform-class-properties

最后都变了- 提交于 2019-12-11 02:38:05
问题 I'm trying to use MobX in my project and I am attempting to use class properties. However, when I run through browserify (with Laravel's Elixir). I get the error Missing class properties transform. while parsing file . Is there something I'm missing to get class properties to work with browserify? Browserify Failed!: /Users/.../resources/assets/js/pages/Show/CampaignStore.js: Missing class properties transform. while parsing file: /Users/.../resources/assets/js/pages/Show/CampaignStore.js

How do I setup React?

江枫思渺然 提交于 2019-12-10 22:16:07
问题 Please, I just want to start learning React, but I am not sure how to install it. Browserify was recommended but I have never used it before so I am confused. After this command: npm install --save react react-dom babelify babel-preset-react , what do I do next? How do I create a folder and start using React? And what does this other command mean, browserify -t [ babelify --presets [ react ] ] main.js -o bundle.js ? 回答1: I'd recommend starting with the official tutorial instead of the getting

How to include non node modules using browserify

旧城冷巷雨未停 提交于 2019-12-10 20:58:44
问题 I want to use a dependency management in application and came across require.js and browserify . i am unable to decide which one to go with. It would be a decicive factor if any one can tell me how i can include custom made javascript modules (non node modules) into my js. I see browserify is including node modules with ease. 回答1: Let's say we want to encapsulate following functionality into module: sayHelloInEnglish = function() { return "Hello"; }; Then we create file greetings.js like that