title: Sending a parameter from node file to package.json script command
body: <p>This is a file named myFile.js I execute with node:</p>
  <pre><code>var aa = `npm run build -- --main=src/` + (component === `widget` ? `thisPath/` : ``) + `${component}/myFile.ts`;
  execSync(`${aa} `);
  </code></pre>
  <p>This is in a foreach loop, value of 'component' changes in each loop.</p>
  <p>And this is the build command in my package.json:</p>
  <pre><code>&quot;build&quot;: &quot;ng build --aot --outputHashing=\&quot;all\&quot; --sourceMap=false --vendorChunk=false --extra-webpack-config elements-webpack.config.js --single-bundle&quot;
  </code></pre>
  <p>And this is my elements-webpack.config.js file:</p>
  <pre><code>const path = require('path');
  const uuidv1 = require('uuid/v1');
  
  console.log(process.argv);
  var pathData = process.argv[10];
  
  module.exports = {
    output: {
      filename: pathData === 'main' ? '[name].[contenthash].js' : '[name].[contenthash].js',
      jsonpFunction: 'myElements-' + uuidv1(),
      library: 'elements'
    },
    externals: {
      &quot;rxjs&quot;: &quot;rxjs&quot;,
      &quot;@angular/core&quot;: &quot;ng.core&quot;,
      &quot;@angular/common&quot;: &quot;ng.common&quot;,
      &quot;@angular/common/http&quot;: &quot;ng.common.http&quot;,
      &quot;@angular/platform-browser&quot;: &quot;ng.platformBrowser&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;ng.platformBrowserDynamic&quot;,
      &quot;@angular/compiler&quot;: &quot;ng.compiler&quot;,
      &quot;@angular/elements&quot;: &quot;ng.elements&quot;,
      &quot;@angular/forms&quot;: &quot;ng.forms&quot;,
      &quot;@angular/router&quot;: &quot;ng.router&quot;
    }
  };
  </code></pre>
  <p>What I want to do is send a parameter from myFile.js to the command in package.json so that I get it in the webpack config file. The parameter is the value of the 'component' variable.</p>
  <p>I think it should look like this:</p>
  <pre><code>var aa = `npm run build -- --main=src/` + (component === `widget` ? `thisPath/` : ``) + `${component}/myFile.ts` + ` ${component}`;
  </code></pre>
  <p>But then I dont know how to catch it in package.json.</p>