function minifyWithTerser()

in scripts/build.js [140:157]


function minifyWithTerser(seriesPath, dirName) {
  const terserPath = path.join(__dirname, '../node_modules/.bin/terser');
  try {
    execSync(
      `${terserPath} ${seriesPath}/dist/index.js \
          --compress \
          --mangle \
          --ecma 3 \
          --comments all \
          --source-map \
          --output ${seriesPath}/dist/index.min.js`
    );
    console.log(`Minified custom series ${dirName} using Terser`);
  } catch (e) {
    console.error(`Error minifying custom series ${dirName}:`);
    console.error(e.message);
  }
}