Giter Club home page Giter Club logo

browserify-global-shim's People

Contributors

asiniy avatar cperryk avatar rluba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

browserify-global-shim's Issues

no leading "window."?

Is there a way to make the replacement code not use the leading window. so that resolution is based on whatever happens to be available, scoped?

Dependency's dependency not shimmed

I'm using browerify-global-shim to shim React, which has worked great until now.

The problem I've encountered is in using react-chartify. I can see from the bundle that all my instances of React are assigned to window.React. However, the code from react-chartify still has React = require('react') even after the transformation.

Thus my web app now contains conflicts caused by having two instances of React.

How do I solve this?

Transform is processing non-JS files; use includeExtensions transform tools option

I'm requiring CSS files and Mustache files using browserify-css and hoganify. I'm finding that browserify-global-shim does not play well with this because it is trying to process these files that aren't JS files. It leads to a SyntaxError: Unexpected Token.

To fix this, use the includeExtensions option that Browserify-transform-tools features. It limits the transform to files with one of the listed extensions. I was able to get around the bug by editing browserify-global-shim.js like so:

module.exports = transformTools.makeRequireTransform('browserify-global-shim',
    {
        evaluateArguments: true,
        includeExtensions: ['js'] // <-- PROCESS ONLY JS FILES
    },
    function(args, opts, cb) {
        var shimmedModules = opts.config || {};
// etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.