Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Ember 2, ember-cli, custom addon, hook to modify text in js before final integrity (ember-cli-sri)

$
0
0

@johnunclesam wrote:

After this question Modify app.js and vendor.js before the final integrity seal. How to? I’m building an addon for modify the js before the final integrity step (with ember-cli-sri).

lib/modify-js-before-build/index.js

/* eslint-env node */
'use strict';

module.exports = {
  name: 'modify-js-before-build',

  isDevelopingAddon() {
    return true;
  },

  postprocessTree(type, tree) {

    // WHAT TO DO!?

  }

};

lib/modify-js-before-build/package.json

{ ...,
"ember-addon": {
    "before": "ember-cli-sri"
  }
}

But I’m stucked here, I don’t know how to do (I do not know very well broccoli). How can I tell it to add some text in my app.js and vendor.js before ember-cli-sri and other build steps?

I found this one: https://github.com/DockYard/ember-cli-one-script/blob/master/index.js. They are using broccoli-concat and broccoli-merge-trees. Something similar to me? But how?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles