browserify

Don't invoke inherited method twice in ES6 classes

一曲冷凌霜 提交于 2019-12-12 06:49:10
问题 I'm moving from RequireJS to browserify (together with babelify) and try to rewrite my current modules to classes. For each of my RequireJS modules I have a method called eventHandler which handles all module specific events. Now when I extend a class, the parent class calls the subclass`s eventHandler method which leads to invoking the method twice. Parent class: 'use strict'; class Tooltip { constructor() { this.eventHandler(); } eventHandler() { // Module specific events } } module.exports

unable to import jquery dependencies in vue-browerify template

我的未来我决定 提交于 2019-12-12 05:16:00
问题 I am using vue js browerify and i have installed jquery i am using jquery as import $ from 'jquery and it works. To import anyother dependency like semantic.js or jquery.ui is it throwing errors. I have read and tried all the related posts on stackoverflow. when i do import $ from 'jquery import 'jquery-ui it says jQuery in not defined. i have tried the extend method. it still does not work. I also have tried to include the files on my index.html usng the <Script src> tag . and it says $ not

How to investigate “Cannot find module X” coming from browserified bundles?

一世执手 提交于 2019-12-12 04:58:38
问题 Desperate mode: Tried many different configs and all failed. I have a browserified + babelified bundle called videomail-client.js here: https://github.com/binarykitchen/videomail-client/tree/develop/dist The package.json's main entry of that package is pointing to this file. Now, when I require() that package from another project within and browserify it, then I see this error from the gulp task using browserify: [16:26:32] Error: Cannot find module './keys' from '/home/michael-heuberger/code

karma-browserify coverage reports contain file include paths instead of source code

和自甴很熟 提交于 2019-12-12 03:02:08
问题 Using karma-browserify to do unit tests with Jasmine. The tests correctly run but the coverage reports show file include paths instead of source code. You can reproduce this by installing the following project and run 'gulp unit': https://github.com/bshack/shackstack Here is an example of the coverage report contents: typeof require === "function" && require("/xxx/xxx/xxx/shackstack/app/media/script/service/utilities.js"); Here is my karma.config: module.exports = function(karma) { 'use

Difference between import and import from

我怕爱的太早我们不能终老 提交于 2019-12-12 02:42:24
问题 I'm looking through some ES6/browserify tutorials and I see something like: import 'jquery'; import domready from 'domready'; What is the difference between import and import from? If I use just import domready - domready fails to work. 回答1: Your first line import 'jquery'; // is functionally equivalent to require('jquery'); Your second line import domready from 'domready'; // is technically equivalent to var domready = require('domready'); So you can probably see why the second one is the

How to browserify a file that includes a node module with an equivalent client version?

纵然是瞬间 提交于 2019-12-12 02:39:59
问题 Found a package that does replace, going to test with that. Now if file.node gets replaced with file.min.js my question would be, how to not browserify this dependency i.e. not browserify file.min.js again ? I've a package that has a browserified and minified file.min.js and its node version file.node it is used (as in modName = require("file.node") ) by many files. but file.node cannot be browserified. don't ask why. Many files depend upon modName module. The file.min.js also contains

How to exclude library files from browserify bundle

核能气质少年 提交于 2019-12-12 00:43:12
问题 I want to avoid cluttering up my distribution bundle with library files and use separate script tags for them in the HTML. One way is like this... m1.js module.exports = "first module"; m2.js module.exports = "second module"; cnd-m1.js var m1 = "first module"; main.js var m1 = this.m1 || require("./src/m1"); var m2 = require("./src/m2"); console.log(m1); console.log(m2); index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>browserify test</title> </head> <body>

Enable “Experimental support for decorators” with “tsify” in karma

我的梦境 提交于 2019-12-11 23:47:24
问题 I'm using tsify, a plugin for browserify, to transpile my code during karma unit tests. I get this sort of erro when I run my tests: TypeScript error: src/app/emailLogin/emailLogin.component.ts(14,14): Error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning. How do enable experimentalDecorators in browserify/tsify, which are specified in my karma.config.js Here is my karma

Bundling browserified libraries

谁说胖子不能爱 提交于 2019-12-11 17:01:54
问题 I'm having problems finding a canonical approach to building apps with cascading browserified dependencies. I've got a dependency chart that looks something like this: angular --> lib 1 --> lib 2 --> application Both libraries and the app are CommonJS Angular modules. I'd like to bundle each library separately so they can be used independently and/or in non-CJS apps. When I bundle the app, I want to include all upstream deps (angular, lib1, lib2, etc) in a single vendors.js and the

Are Asynchronous Modules Always Asynchronous?

泪湿孤枕 提交于 2019-12-11 14:29:35
问题 When multiple JavaScript modules are define()'d using AMD and concatenated into a single file, are those modules still considered asynchronous? 回答1: Yes, they are still considered async. While the module itself doesn't have to be loaded from disk, the modules do need to be executed and there is a call back made. Because you can combine SOME modules into a single file doesn't mean you have to combine all -- nor does RequireJS assume all there. It will run what it can from your preload and