GithubHelp home page GithubHelp logo

Comments (17)

stefanpenner avatar stefanpenner commented on June 12, 2024

@dlo83 sounds like a breaking change on there side, we may want to lock our version down ...

My guess is this tripped up during uglification of a somewhat large file?

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

Correctamundo.

from broccoli-terser-sourcemap.

stefanpenner avatar stefanpenner commented on June 12, 2024

@dlo83 can you share the size, im curious if there is a specific cliff. Although i suspect it is depth complexity not overall size.

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

@stefanpenner I already downgraded to 2.5, so give me a few to try and recreate again and give you more specifics. In the meantime, could I tag you in to the discussion at mishoo/UglifyJS#863 ? The uglifyJS dev wants more information as to how this plugin calls uglify, and being fairly new to Ember, I'm not sure I'm the best resource on the subject.

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

@stefanpenner, I'm not sure how to get more verbose metrics/logs around the error; I pasted it directly from the terminal into the GitHub ticket. If you could shed some more light on how I can grab more in-depth information for you, I'd be happy to help.

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

@stefanpenner, does this plugin allow for compress options to be configured? I can avoid the uglify errors if I set "sequences" to false.

from broccoli-terser-sourcemap.

stefanpenner avatar stefanpenner commented on June 12, 2024

yes options are passed straight through:

If you have an idea how to make this obvious in the readme a PR would be lovely.

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

Sure, I'll try it out for myself to verify and then create a PR.

from broccoli-terser-sourcemap.

danlourenco avatar danlourenco commented on June 12, 2024

@stefanpenner, sorry if this is a noob question, but I'm trying to figure out where I would override these options within the context of our Brocfile. (We're using an older version of Ember, so no .ember-cli)

Where in the following snippet would I pass through those compressor options ultimately consumed by uglify-js?

var app = new EmberApp(defaults, {
    sourcemaps: {
      enabled: true,
      extensions: ['js']
    },
    minifyCSS: { enabled: true },
    minifyJS:  { enabled: true },

There is currently no configuration in our Brocfile for ember-cli-uglify, which I believe leverages this plugin, so I'm at a loss for how to pass this configuration down the stack.

from broccoli-terser-sourcemap.

blimmer avatar blimmer commented on June 12, 2024

I'm suddenly experiencing this same problem. Trying to investigate, but it seems like we might want to peg the version and do a release in the meantime so people aren't stuck.

from broccoli-terser-sourcemap.

stefanpenner avatar stefanpenner commented on June 12, 2024

but it seems like we might want to peg the version and do a release in the meantime so people aren't stuck.

yes, i am tempted. Would except a PR doing this as an interim step.

from broccoli-terser-sourcemap.

blimmer avatar blimmer commented on June 12, 2024

Confirming that locking to ~2.5.0 works on my project, then a PR is on the way.

from broccoli-terser-sourcemap.

blimmer avatar blimmer commented on June 12, 2024

Confirm that the PR (#18) resolves the issue on my project.

from broccoli-terser-sourcemap.

blimmer avatar blimmer commented on June 12, 2024

This isn't a long-term solution, but I determined that this issue occurred only when I was building for my staging environment, not my production environment.

In looking at the produced code, I realized that all of my tests were being included in the app.js file that was being passed to uglifyjs for my staging environment. By telling ember-cli to not include tests in my staging build, I have this working against 1.0.1.

I turned off tests by including this statement in my Brocfile.js (or ember-cli-build.js).

var isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1;

var app = new EmberApp({
  tests: !isProductionLikeBuild,
  ...
});

Not a great long-term solution, but this might help those in a pinch.

from broccoli-terser-sourcemap.

stefanpenner avatar stefanpenner commented on June 12, 2024

Cli has no concept of staging. Production plus env vars to configure the build is prescribed. Otherwise the user must reimplement the rest of the concepts. Unsure how other plugins and addons could work this way.

from broccoli-terser-sourcemap.

blimmer avatar blimmer commented on June 12, 2024

Yep, I have to re-implement some behavior in my build file for the staging environment. I turn back on minification of JS and CSS, embed certain inline content (e.g. external scripts), etc.

However, I didn't think/realize my tests were being included and that turned out to be the addition that was pushing uglify js over the edge for me. I could see others with similar apps to mine (with lots of tests) potentially running into this issue in their staging environments (as they're pretty darn common) before the new release is out #20 . Additionally, people might have to nombom unless a new version of ember-cli-uglify is released with a dependency bump for this project.

from broccoli-terser-sourcemap.

stefanpenner avatar stefanpenner commented on June 12, 2024

tmp fix, hopefully uglify fixes 4reals soon.

➜  broccoli-uglify-sourcemap git:(master) npm publish
+ [email protected]

from broccoli-terser-sourcemap.

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.