browserify

React and Browserify Register Component Error

痞子三分冷 提交于 2019-12-25 01:49:46
问题 I am using browserify, gulp and reactjs together, I have the following app.js contains my other scripts; var React = window.React = require('react'); var Signup = require('./ui/Signup'); var Login = require('./ui/Login'); `Signup.js`` var React = require('react'); var signupNode = document.getElementById('signup'); var SignupApp = React.createClass({ render: function(){ return (<Signup/>) } }); var Signup = React.createClass({ render: function(){ return ( <div> <div classNameName="form-block

Using Google Maps api V3 with angular and browserify

核能气质少年 提交于 2019-12-24 22:36:24
问题 I am trying to use the Google Maps Javascript Api V3 inside a Angular + browserify app. I do not use bower. Previously I was doing that with requirejs, and a plugins on git hub millermedeiros/requirejs-plugins called async. I was able to load gmaps like this (most of the time, sometimes requirejs was still requireing gmaps too early. // load gmap as an amd module define(['config'], function(config){ define('gmaps', ['async!http://maps.google.com/maps/api/js?v=3&sensor=false&libraries=places

Including libraries fails - what is document root?

只愿长相守 提交于 2019-12-24 16:00:23
问题 I have a file ( src/inc.js ) that loads certain files into my browser using jquery's ajax: $.ajax({url: 'somefile.js', async: false, dataType: 'script', error: function(qXHR, textStatus, errorThrown) { console.log( '[' + textStatus + '] ' + errorThrown + ' with: ' + this.url ); } }); and this file gets included via browserification into my browser (phantomjs). Gruntfile.js : browserify: { libs: { src: ['src/*.js'], dest: 'test/libs.js' } } and handed to karma (in Gruntfile.js ): karma: {

Webpack creating duplicate entries for dependencies

落花浮王杯 提交于 2019-12-24 14:27:39
问题 I am trying to switch from using browserify to webpack. One thing browserify handled nicely was dependency management inside dependencies. Let me give an example: Main app project: var util1 = require('shared-components/util1'); var util2 = require('shared-components/util2'); Inside shared-components/util1.js var util2 = require('../util2'); Browserify would realize that the reference to util2 in both scenarios was the same but it appears that Webpack does not which creates duplicate entries

Webpack equivalent for browserify shiming(global) of already included modules

有些话、适合烂在心里 提交于 2019-12-24 14:13:51
问题 I am wondering what the webpack equivalent of browserify shiming is? I develop a widget using npm and webpack which is included in another app. This other app already includes moment.js already in a script tag. I don't want to bundle moment.js again in the widget bundle but still be able to use it. ( import moment from 'moment' ). In browserify this was done with a global:moment statement. Does someone know the webpack equivalent? 回答1: I figured it out. I put the following in my webpack

TypeError: g.rangy.saveSelection is not a function using textangular + rangy + browserify

ぃ、小莉子 提交于 2019-12-24 12:26:24
问题 I am trying to implement textAngular into my Angular.js project that is packaged using browserify . I installed rangy and textAngular via npm . They are included like this: global.rangy = require('rangy'); require('angular-sanitize'); require('textangular'); When compiling the package with browserify via gulp , no errors are shown. However, as soon as I click on a button in the toolbar of the editor, I get the following error: TypeError: g.rangy.saveSelection is not a function at Scope.m

Watchify + tsify + Visual Studio == stale code

为君一笑 提交于 2019-12-24 10:57:48
问题 We are running a Gulp task inside of Visual Studio (2015) to execute watchify. Works great some of the time, but sometimes watchify builds old code. Repro: Modify a .ts file in Visual Studio Save In the Task Runner Explorer, watch for watchify output, indicating that it ran (it does) Refresh Chrome/clear cache (I use the "disable caching while debug window is open" option in Chrome) View source in the Chrome Debugger (a little less than half the time, it will be the old code) Any idea what I

Emberjs / ember-browserify : “X is not a constructor”?

血红的双手。 提交于 2019-12-24 10:27:00
问题 This question relates to my earlier question. Trying to use howler.js (https://github.com/goldfire/howler.js#documentation) in a Controller. There is no addon for Howler but it exists as a npm package. I've followed the instructions to use ember-browserify and then started the ember dev server ( ember s ). The import looks like this : import Howl from "npm:howler"; I've also tried this : import {Howl as Howl} from "npm:howler" ; and this : import {Howl} from "npm:howler" ; In all cases when I

Browserify watchify compile old ressource on localhost with VueComponent

爱⌒轻易说出口 提交于 2019-12-24 07:21:26
问题 I'm pretty new on compiler and npm command. I use this starter for a project https://github.com/vuejs-templates/browserify-simple I served my project and I was working on when I update a script (I'm working with Single File Component - VueJS) and now the output "dist.js" is still in error due to old script. I have reinstall, create a new project, I copy my new sources and when I launch the command "npm run dev" I have the same error due to script which does't exist anymore. TypeError: Cannot

Browserify watchify compile old ressource on localhost with VueComponent

Deadly 提交于 2019-12-24 07:20:09
问题 I'm pretty new on compiler and npm command. I use this starter for a project https://github.com/vuejs-templates/browserify-simple I served my project and I was working on when I update a script (I'm working with Single File Component - VueJS) and now the output "dist.js" is still in error due to old script. I have reinstall, create a new project, I copy my new sources and when I launch the command "npm run dev" I have the same error due to script which does't exist anymore. TypeError: Cannot