Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 运行npm脚本以部署到s3_Javascript_Node.js_Amazon Web Services_Npm - Fatal编程技术网

Javascript 运行npm脚本以部署到s3

Javascript 运行npm脚本以部署到s3,javascript,node.js,amazon-web-services,npm,Javascript,Node.js,Amazon Web Services,Npm,我有一个简单的express应用程序,它提供一些配置供客户端包使用: const config = config.get('client'); const HTML = ` <!DOCTYPE html> <html> <head> </head> <body> <div id="client"></div>

我有一个简单的express应用程序,它提供一些配置供客户端包使用:

    const config = config.get('client'); 

    const HTML = `
    <!DOCTYPE html>
    <html>
      <head>
      </head>
      <body>
        <div id="client"></div>
        <script>
          window.config = ${JSON.stringify(config)}
        </script>
        <script src="/bundle.js"></script>
      </body>
    </html>
    `;

    res.status(200).send(HTML);
一旦运行了,下一步就是将其上传到s3 bucket,这样就需要运行另一个节点脚本。我可能会最终得到一个运行以下命令的
npm运行部署

npm run build-html && npm run-deploy-static

我不确定是否有更好/更被接受的方法来做这类事情?运行两个节点脚本以部署我的应用程序的一部分是否正确

也许html网页包插件和s3插件网页包是适合这份工作的插件?也许html网页包插件和s3插件网页包是适合这份工作的插件?
npm run build-html && npm run-deploy-static