browserify

babelify pipe results in: The code generator has deoptimised the styling of “/…/jquery.js” as it exceeds the max of “100KB”

白昼怎懂夜的黑 提交于 2020-01-06 23:49:32
问题 I'm trying to create a single js file containing jquery, bootstrap and reactjs components using a gulp task: app.jsx: var React = require('react'); var ReactDOM = require('react-dom'); var HelloWorld = require('./Application.jsx'); var $, jQuery = require('../../libraries/jquery/dist/jquery'); var bootstrap = require('../../libraries/bootstrap-sass/assets/javascripts/bootstrap'); ReactDOM.render( <Application />, document.getElementById('example') ); gulp task: gulp.task('js', function () {

Error using karma-browserify with browserify-shim

一世执手 提交于 2020-01-06 03:55:05
问题 I'm trying to use karma-browserify together with browserify-shim with no success. Here is a repo to reproduce the error: https://github.com/pelizza/karma-browserify-shim PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR TypeError: undefined is not an object (evaluating 'module.exports = ex') at /var/folders/_0/ql88mbyd6v34qsmysr5kf4780000gn/T/e0c5e5ebe3f49930de3d988c7196737f.browserify:40308 <- bower_components/jquery/dist/jquery.js:9837:0 Everything works fine when bundling with browserify, by it seems

browserify 'Error: Cannot find module' in trying to fix 'Uncaught reference error: require is not defined'

末鹿安然 提交于 2020-01-05 04:05:31
问题 I am having a very similar, or almost exact, issue to @RachelD from this thread (Node.js + Angular = Uncaught ReferenceError: require is not defined) regarding the Uncaught reference error. However, when I run my 'browserify' command as stated in the directions here (https://github.com/substack/node-browserify) and exactly as shown below (I included my directory as well for reference)... myname@compname:~/workspace/MyApp $ browserify /app/scripts/controllers/main.js > bundle.js I am getting a

Move browserify workflow into gulp task [vueify, browserify, babelify]

强颜欢笑 提交于 2020-01-05 02:28:11
问题 I'm trying to migrate the following browserify workflow into a single gulp task: package.json: "scripts": { "build": "browserify src/main.js > dist/build.js" }, ... "browserify": { "transform": [ "vueify", "babelify" ] } .babelrc file: { "presets": ["es2015"] } Since gulp-browserify is now longer maintained, I used this recipe to get the whole workflow into a single gulp task: gulp.task('build', function () { var b = browserify({ entries: './src/main.js', debug: true, transform: [vueify,

Modules exported using es6 syntax for the browser

雨燕双飞 提交于 2020-01-04 13:44:23
问题 I have a module module-A which has the following in index.js import SomeModule from './lib/some-module' import AnotherModule from './lib/another-module' module.exports ={ SomeModule: SomeModule, AnotherModule: AnotherModule } I then use this module-A from another module-B : import SomeModule from `module-A` I now want to build module-B for the browser, so I use browserify from the module-B cwd: [I am using babel 6.0] browserify index.js -t [ babelify --presets [ es2015 ] ] This throws an

d3-tip npm module not working with browserify

女生的网名这么多〃 提交于 2020-01-04 06:53:07
问题 First I installed d3-tip with npm install d3-tip v0.6.7 then browserify'd my project without any issues. My js looks like the following var d3 = require("d3"); var d3tip = require("d3-tip"); var tip = d3tip() .attr('class', 'd3-tip') .offset([-10, 0]) .html(function(d) { return "<strong>Hello World:</strong>"; }); The error I get is: TypeError: d3 is undefined in my bundle.js yet I'm using d3 elsewhere in my code without issue which makes me believe the error is in the npm module for d3 tip

how to set up grunt + browserify + tsify + babelify?

我与影子孤独终老i 提交于 2020-01-04 06:09:27
问题 I am struggling to set up grunt + browserify + tsify + babelify (with debug). The below gruntfile setting does compile typescript, but no babel transpling is happening. Can anybody let me know how to do this? (i might need to use gulp to do this??) browserify: { main: { src: 'app/scripts/main.ts', dest: 'app/scripts/bundle.js', }, options: { browserifyOptions: { plugin: [['tsify']], transform: [['babelify', {presets: ['es2015'], extensions: ['.ts']}]], debug: true } } } tsconfig.json has

Requiring My Own Modules

点点圈 提交于 2020-01-04 05:27:31
问题 I am working up a proof of concept for the Segregated DOM pattern and am using Browserify as my asset pipeline. As a result I am "requiring" modules as I need them in the code. Please see this very simple code example: var loginForm = require('page-objects/loginForm'); lf = loginForm(); lf.signInButton.on('click', function(event){ event.preventDefault(); lf.email.val('TEST') }) and here is the page object: module.exports = LoginForm; function LoginForm(){ var $ = require('jQuery'), navbarForm

Grunt-browserify+mapify+coffeescript = module not found with relative path

隐身守侯 提交于 2020-01-04 01:57:07
问题 I try to get grunt-browserfy working with relative path for coffeescript but I always have an error message when I try to build my sources : >> Error: module "src/app/utils/includeMixin" not found from "/[ABSOLUTE-PATH-TO-MY-PROJECT]/project/src/app/app-audit.coffee" I have my file hierarchy presented like this : project |- build | |- libs.js | |- audit.js |- src |- app |- app-audit.coffee |- utils |- includeMixin.coffee |- vendor |- node_modules |- gruntfile.coffee I use grunt-browserify

vueify (in gulp task) with babel transform of vue files

﹥>﹥吖頭↗ 提交于 2020-01-03 17:19:12
问题 fixed. The solution is to: pass through .transform(babelify) as well ensure all your .vue -file script elements look like <script type="text/javascript"> -- that type attribute must come before custom attributes, lang attribute.. might ahve to be the first, even only attribute on the tag. I think my problem is that I have es6 in my vues. I am getting: [09:33:36] Starting 'public'... events.js:160 throw er; // Unhandled 'error' event ^ SyntaxError: 'import' and 'export' may appear only with