browserify

browserify source map not working if require underscore

岁酱吖の 提交于 2020-01-03 08:14:10
问题 I use browserify for my angular client app. I need to use underscore. angular is installed with bower and underscore is installed with npm This is how I run browserify (npm) and create source map in gulp (npm) gulp.task('browserify', function() { return browserify(dir.script_from + '/main.js', {debug: true}) .bundle() .pipe(source('bundle.js')) // gives streaming vinyl file object .pipe(buffer()) // <----- convert from streaming to buffered vinyl file object .pipe(sourcemaps.init({loadMaps:

Angular js 1.6.9 tests Unknown provider: $$taskTrackerFactoryProvider

筅森魡賤 提交于 2020-01-03 07:31:08
问题 My project is forced to be in 1.6.9 due to regression risks (for example, lowercase is obsolete in 1.7). But recently, I made a npm update and all my karma/phantomjs tests are failing, giving PhantomJS 2.1.1 (Windows 7.0.0) Error: [$injector:unpr] Unknown provider: $$taskTrackerFactoryProvider <- $$taskTrackerFactory <- $browser <- $rootScope <- $browser http://errors.angularjs.org/1.6.9$injector/unpr?p0=%24%24taskTrackerFactoryProvider%20%3C-%20%24%24taskTrackerFactory%20%3C-%20%24browser%20

How do I properly separate my app.js and vendor.js bundles using Browserify?

冷暖自知 提交于 2020-01-02 08:09:43
问题 My goals are to include the following in my HTML file and have them all work properly: index.html: <script type="text/javascript" src="./vendor.js"></script> <script type="text/javascript" src="./app.js"></script> $(document).ready(function() { // jQuery should be available as `window.$` $(".myclass").doSomethingWithJquery(); } <div class="row"> <h1 class="col-md-3 col-md-offset-3"> I should be able to use bootstrap, including bootstrap's javascript libraries, in my templates </h1> </div> <!-

Cannot find module 'browserify'

一曲冷凌霜 提交于 2020-01-02 02:12:13
问题 I'm getting this error: Error: Cannot find module 'browserify' When I add this line to my app/server.js file: var browserify = require('browserify'); Now I'm still new to Node, but I think I installed it correctly, via npm install -g browserify as per their docs. I'm pretty sure this is the command to check my global modules: D:\Websites\MySite> npm ls -g C:\Users\Mark\AppData\Roaming\npm ├─┬ browserify@1.17.2 │ ├─┬ buffer-browserify@0.0.4 │ │ └── base64-js@0.0.2 It lists browserify there. So

Gulp TypeError: Path must be a string. Received undefined

[亡魂溺海] 提交于 2020-01-01 16:07:12
问题 I want to run build command but got the error message: TypeError: Path must be a string. Received undefined. Do you guys have any ideas? Thanks. gulp.task('build', function () { browserify("./src/components/source.js") .transform("babelify", {presets: ["es2015", "react"]}) .bundle() .pipe(gulp.dest(path.resolve(__dirname, './src/app.js'))); }); Below is the tracestack details: TypeError: Path must be a string. Received undefined at assertPath (path.js:8:11) at Object.posix.resolve (path.js

Gulp TypeError: Path must be a string. Received undefined

≡放荡痞女 提交于 2020-01-01 16:06:53
问题 I want to run build command but got the error message: TypeError: Path must be a string. Received undefined. Do you guys have any ideas? Thanks. gulp.task('build', function () { browserify("./src/components/source.js") .transform("babelify", {presets: ["es2015", "react"]}) .bundle() .pipe(gulp.dest(path.resolve(__dirname, './src/app.js'))); }); Below is the tracestack details: TypeError: Path must be a string. Received undefined at assertPath (path.js:8:11) at Object.posix.resolve (path.js

How can I use factor-bundle with browserify programmatically?

房东的猫 提交于 2020-01-01 09:54:29
问题 I want to use factor-bundle to find common dependencies for my browserify entry points and save them out into a single common bundle: https://www.npmjs.org/package/factor-bundle The factor-bundle documentation makes it seem very easy to do on the command line, but I want to do it programmatically and I'm struggling to get my head around it. My current script is this (I'm using reactify to transform react's jsx files too): var browserify = require('browserify'); var factor = require('factor

AngularJS RequireJS Browserify and the Javascript module/global scope nightmare [closed]

我的未来我决定 提交于 2020-01-01 09:47:10
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I have been digging a bit lately in all this CommonJS vs AMD battle and this is my findings... ( BTW I am not preaching here I am sharing my thoughts to get some constructive insights... ) The RequireJS brings to much complexity to my Angular modules, it feel wrong to me as

How to use browserify with non-npm libraries?

混江龙づ霸主 提交于 2020-01-01 06:28:10
问题 According to http://www.slant.co/topics/1089/viewpoints/1/~what-are-the-best-client-side-javascript-module-loaders~browserify#9 one of the downside of using Browserify is that: Not all javascript libraries have an npm version While it's not too hard to create npm package for an existing library, it means maintaining it when the library updates. While most libraries are now on npm, many client side specific libraries are not. I don't have any experience with npm aside from knowing how to

using jquery with browserify

自古美人都是妖i 提交于 2020-01-01 05:27:07
问题 I am trying to use jQuery with browserify with the module jquery-browserify. I required the module in my client.js script as such: var $ = require('jquery-browserify'); and when I run my node server, after i've ran browserify, i get a "window is not defined" error. What am I doing wrong? 回答1: jQuery is now CommonJS compliant, as of version 2.1.0 回答2: Browserify can process CommonJS modules as well as AMD modules with the deamdify transform so now there should be no need to use a shim. To be