Giter Site home page Giter Site logo

Comments (1)

sparkyfen avatar sparkyfen commented on September 22, 2024

I'm also have a similar issue with my concatted/minified code. Digging into the issue, it seems that the non-minified code in oauth.js is in fact slightly minified which might be causing issues for people with task runners which minify their own and vendors code.

Taking a look into the Gruntfile.js for this project, it appears that when the Coffeescript is converted to Javascript, there is an uglify task which mangles the variables.

https://github.com/oauth-io/oauth-js/blob/master/Gruntfile.js#L56

I believe to fix the non-minified file, you can simply use the following for that task:

// Gruntfile.js
uglify: {
  my_target: {
    files: {
      './dist/oauth.min.js': ['dist/oauth.js']
    },
    options: {
      compress: false,
      beautify: true,
      mangle: false
    }
  }
}

After that, bower should still be updated to use the non-minified file (See #38 ) and then people can minify the code themselves.

Edit:

After pulling down the oauth-js code and compiling it myself, it looks like the minification is done via browserify and there is no option that I can find to tell it not to minify their "preamble" as they call it.

You best bet is to make sure your minification does not attempt to modify oauth.js (or oauth.min.js if you are still using the existing version without a bower.json override (See #38)).

What is easier is if browserify has an option to not minify and then we can create a non-minified oauth.js file and import that to minify ourselves.

from oauth-js.

Related Issues (20)

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.