Separate Ember Addon from vendor.js file to a separate file












0















I'm using a "core"-addon which contains logic that is used in multiple "boilerplate" - ember applications, when I build a boilerplate-application, the addon code is added to the "vendor.js" file found in the "assets"-folder. Is there a way I can make this code build to a separate "my-addon-vendor.js" file?



While browsing I found others with the same need, but an answer has yet to be found.



My "core"-addon is linked to my "boilerplate"-project using "npm link my-core-addon".



Thanks in advance



Versions:




  • Ember Version: 3.5.0

  • Ember CLI: 3.5.0

  • Node: 8.11.3

  • npm: 5.6.0










share|improve this question

























  • is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

    – mistahenry
    Nov 27 '18 at 13:59











  • Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

    – Bert Huys
    Nov 27 '18 at 14:08











  • you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

    – mistahenry
    Nov 27 '18 at 14:16













  • discuss.emberjs.com/t/…

    – mistahenry
    Nov 27 '18 at 14:54
















0















I'm using a "core"-addon which contains logic that is used in multiple "boilerplate" - ember applications, when I build a boilerplate-application, the addon code is added to the "vendor.js" file found in the "assets"-folder. Is there a way I can make this code build to a separate "my-addon-vendor.js" file?



While browsing I found others with the same need, but an answer has yet to be found.



My "core"-addon is linked to my "boilerplate"-project using "npm link my-core-addon".



Thanks in advance



Versions:




  • Ember Version: 3.5.0

  • Ember CLI: 3.5.0

  • Node: 8.11.3

  • npm: 5.6.0










share|improve this question

























  • is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

    – mistahenry
    Nov 27 '18 at 13:59











  • Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

    – Bert Huys
    Nov 27 '18 at 14:08











  • you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

    – mistahenry
    Nov 27 '18 at 14:16













  • discuss.emberjs.com/t/…

    – mistahenry
    Nov 27 '18 at 14:54














0












0








0








I'm using a "core"-addon which contains logic that is used in multiple "boilerplate" - ember applications, when I build a boilerplate-application, the addon code is added to the "vendor.js" file found in the "assets"-folder. Is there a way I can make this code build to a separate "my-addon-vendor.js" file?



While browsing I found others with the same need, but an answer has yet to be found.



My "core"-addon is linked to my "boilerplate"-project using "npm link my-core-addon".



Thanks in advance



Versions:




  • Ember Version: 3.5.0

  • Ember CLI: 3.5.0

  • Node: 8.11.3

  • npm: 5.6.0










share|improve this question
















I'm using a "core"-addon which contains logic that is used in multiple "boilerplate" - ember applications, when I build a boilerplate-application, the addon code is added to the "vendor.js" file found in the "assets"-folder. Is there a way I can make this code build to a separate "my-addon-vendor.js" file?



While browsing I found others with the same need, but an answer has yet to be found.



My "core"-addon is linked to my "boilerplate"-project using "npm link my-core-addon".



Thanks in advance



Versions:




  • Ember Version: 3.5.0

  • Ember CLI: 3.5.0

  • Node: 8.11.3

  • npm: 5.6.0







npm ember.js ember-cli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 13:47







Bert Huys

















asked Nov 27 '18 at 13:39









Bert HuysBert Huys

386




386













  • is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

    – mistahenry
    Nov 27 '18 at 13:59











  • Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

    – Bert Huys
    Nov 27 '18 at 14:08











  • you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

    – mistahenry
    Nov 27 '18 at 14:16













  • discuss.emberjs.com/t/…

    – mistahenry
    Nov 27 '18 at 14:54



















  • is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

    – mistahenry
    Nov 27 '18 at 13:59











  • Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

    – Bert Huys
    Nov 27 '18 at 14:08











  • you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

    – mistahenry
    Nov 27 '18 at 14:16













  • discuss.emberjs.com/t/…

    – mistahenry
    Nov 27 '18 at 14:54

















is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

– mistahenry
Nov 27 '18 at 13:59





is there purely for optimization reasons? It would help to understand your need for this because there might be alternative solutions.

– mistahenry
Nov 27 '18 at 13:59













Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

– Bert Huys
Nov 27 '18 at 14:08





Indeed for optimization and debugging reasons. We want our own custom addon(s) separated from our vendor file which is becoming very large.

– Bert Huys
Nov 27 '18 at 14:08













you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

– mistahenry
Nov 27 '18 at 14:16







you might have best luck discordapp.com/invite/zT3asNS joining the discord and asking in the ember-cli community chat. Your question is nuanced and it'd be easier to answer understanding more deeply the reasons

– mistahenry
Nov 27 '18 at 14:16















discuss.emberjs.com/t/…

– mistahenry
Nov 27 '18 at 14:54





discuss.emberjs.com/t/…

– mistahenry
Nov 27 '18 at 14:54












1 Answer
1






active

oldest

votes


















0














You could do something like this:



  var qrScannerWorker = new Funnel(
'node_modules/qr-scanner/', {
include: ['qr-scanner-worker.min.js'],
destDir: '/libraries/qr-scanner/'
}
);


https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139



this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53501033%2fseparate-ember-addon-from-vendor-js-file-to-a-separate-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You could do something like this:



      var qrScannerWorker = new Funnel(
    'node_modules/qr-scanner/', {
    include: ['qr-scanner-worker.min.js'],
    destDir: '/libraries/qr-scanner/'
    }
    );


    https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139



    this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.






    share|improve this answer




























      0














      You could do something like this:



        var qrScannerWorker = new Funnel(
      'node_modules/qr-scanner/', {
      include: ['qr-scanner-worker.min.js'],
      destDir: '/libraries/qr-scanner/'
      }
      );


      https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139



      this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.






      share|improve this answer


























        0












        0








        0







        You could do something like this:



          var qrScannerWorker = new Funnel(
        'node_modules/qr-scanner/', {
        include: ['qr-scanner-worker.min.js'],
        destDir: '/libraries/qr-scanner/'
        }
        );


        https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139



        this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.






        share|improve this answer













        You could do something like this:



          var qrScannerWorker = new Funnel(
        'node_modules/qr-scanner/', {
        include: ['qr-scanner-worker.min.js'],
        destDir: '/libraries/qr-scanner/'
        }
        );


        https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139



        this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '18 at 15:37









        NullVoxPopuliNullVoxPopuli

        21.1k62166309




        21.1k62166309
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53501033%2fseparate-ember-addon-from-vendor-js-file-to-a-separate-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks