Giter Club home page Giter Club logo

Comments (6)

mattmarcum avatar mattmarcum commented on July 19, 2024 1

I just ran into this bug too. I thought maybe implementing this would fix it: https://github.com/ember-engines/ember-asset-loader#generating-custom-uris but it doesn't

Actually, using generateURI does work:

const config = require('./tests/dummy/config/environment')();

module.exports = function(defaults) {
  let app = new EmberAddon(defaults, {
    // Add options here
    assetLoader: {
      generateURI: function(filePath) {
        return `${config.rootURL}${filePath}`;
      }
    }
  });

Is that the best way to get the config - just require and instantiate it? I tried looking for it in the defaults param but couldn't find it in there.

from ember-asset-loader.

dbouwman avatar dbouwman commented on July 19, 2024 1

For others who land here... earlier this week, I used generateURI in my host app's ember-cli-build.js to inform the host app that the engines should be loaded from our CDN...

We use broccoli-asset-rev along with fingerprintOptions.prepend and this is what the function looks like:

// host-app's ember-cli-build.js
const app = new EmberApp(defaults, {
    assetLoader: {
      generateURI: function (filePath) {
        // if we have specified something to prepend, and the file is in engines-dist...
        if (fingerprintOptions.prepend && filePath.indexOf('engines-dist') > -1) {
          return `${fingerprintOptions.prepend}${filePath.substring(1)}`;
        } else {
          return filePath;
        }
      }
    },
}

This ensures that only files in engines-dist are impacted, and only when fingerprintOptions.prepend is defined. Hope this is useful...

from ember-asset-loader.

trentmwillis avatar trentmwillis commented on July 19, 2024

Yep, an oversight in the implementation. Everything we've tested against was at root.

from ember-asset-loader.

 avatar commented on July 19, 2024

Thanks much... I'll see if I can debug and submit a PR for this.... I've tried to so far but running in to competing priorities right now

from ember-asset-loader.

villander avatar villander commented on July 19, 2024

@rwjblue can you close this issue, please? this approach has gone stale - #33 (comment)

from ember-asset-loader.

dfreeman avatar dfreeman commented on July 19, 2024

Should this have been closed? The proposed solution in #33 was stale, but the issue itself still remains, doesn't it?

from ember-asset-loader.

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.