using webpack publish application for both web and electron











up vote
-3
down vote

favorite












Objective:



Using webpack ver 4, develop/distribute an application in




  1. web as target (already done)


  2. Electron as target (TO DO)

  3. Application will have different functionality by detecting its target i.e Electron dist/dev may have more functions that may not be present in web dist/dev (already done) see here


What I need:



I am having problem with electron setup for same code , Help is nedded here.
Can anyone suggest how i can add dev:electron and build:electron in package.json



Update:
I see there is option https://webpack.js.org/configuration/target/
still trying to figure out how to set it up



Github Repo :



I have created a repo @ https://github.com/mafar/webpack-web-electron
which has working example which works for web target



package.json:




"scripts": {
"dev:web": "cross-env NODE_ENV=dev webpack-serve --open --config webpack.config.js",
"build:web": "webpack -p --progress --mode production --config webpack.config.js"
},










share|improve this question




























    up vote
    -3
    down vote

    favorite












    Objective:



    Using webpack ver 4, develop/distribute an application in




    1. web as target (already done)


    2. Electron as target (TO DO)

    3. Application will have different functionality by detecting its target i.e Electron dist/dev may have more functions that may not be present in web dist/dev (already done) see here


    What I need:



    I am having problem with electron setup for same code , Help is nedded here.
    Can anyone suggest how i can add dev:electron and build:electron in package.json



    Update:
    I see there is option https://webpack.js.org/configuration/target/
    still trying to figure out how to set it up



    Github Repo :



    I have created a repo @ https://github.com/mafar/webpack-web-electron
    which has working example which works for web target



    package.json:




    "scripts": {
    "dev:web": "cross-env NODE_ENV=dev webpack-serve --open --config webpack.config.js",
    "build:web": "webpack -p --progress --mode production --config webpack.config.js"
    },










    share|improve this question


























      up vote
      -3
      down vote

      favorite









      up vote
      -3
      down vote

      favorite











      Objective:



      Using webpack ver 4, develop/distribute an application in




      1. web as target (already done)


      2. Electron as target (TO DO)

      3. Application will have different functionality by detecting its target i.e Electron dist/dev may have more functions that may not be present in web dist/dev (already done) see here


      What I need:



      I am having problem with electron setup for same code , Help is nedded here.
      Can anyone suggest how i can add dev:electron and build:electron in package.json



      Update:
      I see there is option https://webpack.js.org/configuration/target/
      still trying to figure out how to set it up



      Github Repo :



      I have created a repo @ https://github.com/mafar/webpack-web-electron
      which has working example which works for web target



      package.json:




      "scripts": {
      "dev:web": "cross-env NODE_ENV=dev webpack-serve --open --config webpack.config.js",
      "build:web": "webpack -p --progress --mode production --config webpack.config.js"
      },










      share|improve this question















      Objective:



      Using webpack ver 4, develop/distribute an application in




      1. web as target (already done)


      2. Electron as target (TO DO)

      3. Application will have different functionality by detecting its target i.e Electron dist/dev may have more functions that may not be present in web dist/dev (already done) see here


      What I need:



      I am having problem with electron setup for same code , Help is nedded here.
      Can anyone suggest how i can add dev:electron and build:electron in package.json



      Update:
      I see there is option https://webpack.js.org/configuration/target/
      still trying to figure out how to set it up



      Github Repo :



      I have created a repo @ https://github.com/mafar/webpack-web-electron
      which has working example which works for web target



      package.json:




      "scripts": {
      "dev:web": "cross-env NODE_ENV=dev webpack-serve --open --config webpack.config.js",
      "build:web": "webpack -p --progress --mode production --config webpack.config.js"
      },







      javascript webpack electron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 18 hours ago

























      asked 19 hours ago









      django

      1,08842353




      1,08842353





























          active

          oldest

          votes











          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%2f53349097%2fusing-webpack-publish-application-for-both-web-and-electron%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349097%2fusing-webpack-publish-application-for-both-web-and-electron%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

          Costa Masnaga

          Fotorealismo

          Sidney Franklin