title: I am having a problem building my Node app with webpack
body: <p>Let me describe my problem. I have developed a Node.js application with ES6, it is a REST API using several Node modules especially from google-cloud because I am using Google Cloud Vision and Translate APIs. </p>
  
  <p>Until now there is no problem, everything works as expected, but things got wrong when I wanted to run it as a service on a Windows Server. I found a way to do it <a href="https://stackoverflow.com/questions/10547974/how-to-install-node-js-as-windows-service">here</a> using the Node module "node-windows". </p>
  
  <p>I made the service script like in that post and the service got installed and shown in the Windows services list, but when I click to start it stops immediately. </p>
  
  <p>After some analyzing I remembered that I am using ES6 that needs to be transpiled to ES5 to work like a standard Node script, so I thought that building my whole app with webpack will solve that for me, but not exactly, I got my bundle.js generated with webpack without any error (just some warnings), then when I try to run it with <code>node ./bundle.js</code> it returns errors like :</p>
  
  <p><code>Error: The include '/protos/google/cloud/vision/v1/image_annotator.proto' was not found.</code></p>
  
  <p>Though I made a rule in my webpack config file to support .proto files.</p>
  
  <p>This is my <strong>webpack.config.js</strong> :</p>
  
  <pre><code>module.exports = {
    target: "node",
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: {
            loader: "babel-loader"
          }
        },
        {
          test: /\.json$/,
          exclude: /node_modules/,
          use: {
            loader: "json-loader"
          }
        },
        {
        test: /\.proto$/,
            use: {
              loader: "pbf-loader"
            }
        },
        {
          test: /\.html$/,
          use: {
            loader: "html-loader"
          }
        }
      ]
    }
  };
  </code></pre>
  
  <p>At this level, I have no idea how to make those google-cloud .proto files to be integrated in my bundel.js, can someone please guide me ? thanks.</p>
  
  <p>This is the code from grpc.js inside the @google-cloud module that tries to resolve the .proto files paths:</p>
  
  <pre><code>GoogleProtoFilesRoot.prototype.resolvePath = function (originPath, includePath) {
          originPath = path.normalize(originPath);
          includePath = path.normalize(includePath);
          // Fully qualified paths don't need to be resolved.
          if (path.isAbsolute(includePath)) {
              if (!fs.existsSync(includePath)) {
                  throw new Error('The include `' + includePath + '` was not found.');
              }
              return includePath;
          }
          if (COMMON_PROTO_FILES.indexOf(includePath) &gt; -1) {
              return path.join(googleProtoFilesDir, includePath);
          }
          return GoogleProtoFilesRoot._findIncludePath(originPath, includePath);
      };
  </code></pre>