How do you get syncfusion to work in an aurelia electron app using webpack?











up vote
1
down vote

favorite












I have Aurelia, Electron, and Webpack working but I would like to include the CDN version of Syncfusion. In a normal web app you can just include it in the HTML file but how do you include it in an Aurelia Electron Webpack app?



In my app.html I have the below code:



<require from="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></require>
<require from="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></require>
<require from="http://cdn.syncfusion.com/16.3.0.29/js/web/ej.web.all.min.js"></require>









share|improve this question




























    up vote
    1
    down vote

    favorite












    I have Aurelia, Electron, and Webpack working but I would like to include the CDN version of Syncfusion. In a normal web app you can just include it in the HTML file but how do you include it in an Aurelia Electron Webpack app?



    In my app.html I have the below code:



    <require from="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></require>
    <require from="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></require>
    <require from="http://cdn.syncfusion.com/16.3.0.29/js/web/ej.web.all.min.js"></require>









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have Aurelia, Electron, and Webpack working but I would like to include the CDN version of Syncfusion. In a normal web app you can just include it in the HTML file but how do you include it in an Aurelia Electron Webpack app?



      In my app.html I have the below code:



      <require from="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></require>
      <require from="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></require>
      <require from="http://cdn.syncfusion.com/16.3.0.29/js/web/ej.web.all.min.js"></require>









      share|improve this question















      I have Aurelia, Electron, and Webpack working but I would like to include the CDN version of Syncfusion. In a normal web app you can just include it in the HTML file but how do you include it in an Aurelia Electron Webpack app?



      In my app.html I have the below code:



      <require from="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></require>
      <require from="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></require>
      <require from="http://cdn.syncfusion.com/16.3.0.29/js/web/ej.web.all.min.js"></require>






      webpack electron aurelia syncfusion






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 at 7:42









      Jesse de Bruijne

      2,44951325




      2,44951325










      asked Nov 19 at 13:22









      dan

      1,63232442




      1,63232442
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          10
          down vote



          accepted










          For your information, Webpack application will bundle the script files in the dist folder which is helpful to run the Electron application.



          To import the Syncfusion JavaScript dependencies files, you can use either of these two ways:




          • Import the script in main.ts file

          • Create a custom JavaScript file for Syncfusion Dependencies


          Import the script in main.ts file



          Import the script in main.ts file as like below code snippet. While importing the Syncfusion JavaScript dependencies as below, it will be bundled in the dist folder.



          ...
          import { PLATFORM } from 'aurelia-pal';
          import * as Bluebird from 'bluebird';
          import 'syncfusion-javascript/Scripts/ej/web/ej.grid.min';

          // remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
          Bluebird.config({ warnings: { wForgottenReturn: false } });

          export async function configure(aurelia: Aurelia) {
          aurelia.use
          .standardConfiguration()
          .developmentLogging()
          .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid());
          ...


          Create a custom JavaScript file for Syncfusion Dependencies



          You have to create a custom JavaScript file for Syncfusion Dependencies (ej.web.all.min.js) and import the created JavaScript files using require in your app.html file.






          share|improve this answer






























            up vote
            0
            down vote













            The require tag is not for external CDNs, but is for local custom elements/value converters/custom attributes/styles. Add the <script src="http://..."> element to your index.html or create a custom element to load the script in a specific component like this.






            share|improve this answer





















            • I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
              – dan
              Nov 20 at 3:57











            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',
            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%2f53375565%2fhow-do-you-get-syncfusion-to-work-in-an-aurelia-electron-app-using-webpack%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            10
            down vote



            accepted










            For your information, Webpack application will bundle the script files in the dist folder which is helpful to run the Electron application.



            To import the Syncfusion JavaScript dependencies files, you can use either of these two ways:




            • Import the script in main.ts file

            • Create a custom JavaScript file for Syncfusion Dependencies


            Import the script in main.ts file



            Import the script in main.ts file as like below code snippet. While importing the Syncfusion JavaScript dependencies as below, it will be bundled in the dist folder.



            ...
            import { PLATFORM } from 'aurelia-pal';
            import * as Bluebird from 'bluebird';
            import 'syncfusion-javascript/Scripts/ej/web/ej.grid.min';

            // remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
            Bluebird.config({ warnings: { wForgottenReturn: false } });

            export async function configure(aurelia: Aurelia) {
            aurelia.use
            .standardConfiguration()
            .developmentLogging()
            .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid());
            ...


            Create a custom JavaScript file for Syncfusion Dependencies



            You have to create a custom JavaScript file for Syncfusion Dependencies (ej.web.all.min.js) and import the created JavaScript files using require in your app.html file.






            share|improve this answer



























              up vote
              10
              down vote



              accepted










              For your information, Webpack application will bundle the script files in the dist folder which is helpful to run the Electron application.



              To import the Syncfusion JavaScript dependencies files, you can use either of these two ways:




              • Import the script in main.ts file

              • Create a custom JavaScript file for Syncfusion Dependencies


              Import the script in main.ts file



              Import the script in main.ts file as like below code snippet. While importing the Syncfusion JavaScript dependencies as below, it will be bundled in the dist folder.



              ...
              import { PLATFORM } from 'aurelia-pal';
              import * as Bluebird from 'bluebird';
              import 'syncfusion-javascript/Scripts/ej/web/ej.grid.min';

              // remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
              Bluebird.config({ warnings: { wForgottenReturn: false } });

              export async function configure(aurelia: Aurelia) {
              aurelia.use
              .standardConfiguration()
              .developmentLogging()
              .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid());
              ...


              Create a custom JavaScript file for Syncfusion Dependencies



              You have to create a custom JavaScript file for Syncfusion Dependencies (ej.web.all.min.js) and import the created JavaScript files using require in your app.html file.






              share|improve this answer

























                up vote
                10
                down vote



                accepted







                up vote
                10
                down vote



                accepted






                For your information, Webpack application will bundle the script files in the dist folder which is helpful to run the Electron application.



                To import the Syncfusion JavaScript dependencies files, you can use either of these two ways:




                • Import the script in main.ts file

                • Create a custom JavaScript file for Syncfusion Dependencies


                Import the script in main.ts file



                Import the script in main.ts file as like below code snippet. While importing the Syncfusion JavaScript dependencies as below, it will be bundled in the dist folder.



                ...
                import { PLATFORM } from 'aurelia-pal';
                import * as Bluebird from 'bluebird';
                import 'syncfusion-javascript/Scripts/ej/web/ej.grid.min';

                // remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
                Bluebird.config({ warnings: { wForgottenReturn: false } });

                export async function configure(aurelia: Aurelia) {
                aurelia.use
                .standardConfiguration()
                .developmentLogging()
                .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid());
                ...


                Create a custom JavaScript file for Syncfusion Dependencies



                You have to create a custom JavaScript file for Syncfusion Dependencies (ej.web.all.min.js) and import the created JavaScript files using require in your app.html file.






                share|improve this answer














                For your information, Webpack application will bundle the script files in the dist folder which is helpful to run the Electron application.



                To import the Syncfusion JavaScript dependencies files, you can use either of these two ways:




                • Import the script in main.ts file

                • Create a custom JavaScript file for Syncfusion Dependencies


                Import the script in main.ts file



                Import the script in main.ts file as like below code snippet. While importing the Syncfusion JavaScript dependencies as below, it will be bundled in the dist folder.



                ...
                import { PLATFORM } from 'aurelia-pal';
                import * as Bluebird from 'bluebird';
                import 'syncfusion-javascript/Scripts/ej/web/ej.grid.min';

                // remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
                Bluebird.config({ warnings: { wForgottenReturn: false } });

                export async function configure(aurelia: Aurelia) {
                aurelia.use
                .standardConfiguration()
                .developmentLogging()
                .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid());
                ...


                Create a custom JavaScript file for Syncfusion Dependencies



                You have to create a custom JavaScript file for Syncfusion Dependencies (ej.web.all.min.js) and import the created JavaScript files using require in your app.html file.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 20 at 15:18









                Jesse de Bruijne

                2,44951325




                2,44951325










                answered Nov 20 at 11:50









                christo issac

                1809




                1809
























                    up vote
                    0
                    down vote













                    The require tag is not for external CDNs, but is for local custom elements/value converters/custom attributes/styles. Add the <script src="http://..."> element to your index.html or create a custom element to load the script in a specific component like this.






                    share|improve this answer





















                    • I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                      – dan
                      Nov 20 at 3:57















                    up vote
                    0
                    down vote













                    The require tag is not for external CDNs, but is for local custom elements/value converters/custom attributes/styles. Add the <script src="http://..."> element to your index.html or create a custom element to load the script in a specific component like this.






                    share|improve this answer





















                    • I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                      – dan
                      Nov 20 at 3:57













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    The require tag is not for external CDNs, but is for local custom elements/value converters/custom attributes/styles. Add the <script src="http://..."> element to your index.html or create a custom element to load the script in a specific component like this.






                    share|improve this answer












                    The require tag is not for external CDNs, but is for local custom elements/value converters/custom attributes/styles. Add the <script src="http://..."> element to your index.html or create a custom element to load the script in a specific component like this.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 20 at 3:21









                    jbockle

                    54329




                    54329












                    • I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                      – dan
                      Nov 20 at 3:57


















                    • I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                      – dan
                      Nov 20 at 3:57
















                    I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                    – dan
                    Nov 20 at 3:57




                    I can't include it in the index.html as this is an electron app. I read about the custom component but I hope there is a better way. If there are no more answers I will mark this as correct
                    – dan
                    Nov 20 at 3:57


















                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375565%2fhow-do-you-get-syncfusion-to-work-in-an-aurelia-electron-app-using-webpack%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

                    Wiesbaden

                    Marschland

                    Dieringhausen