How to use the webpack-chain.toString function in webpack-chain

To help you get started, we’ve selected a few webpack-chain examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Akryum / nodepack / packages / @nodepack / service / src / commands / inspect.js View on Github external
} else if (args.plugins && config.plugins) {
      // @ts-ignore
      res = config.plugins.map(p => p.__pluginName || p.constructor.name)
    } else if (paths.length > 1) {
      res = {}
      paths.forEach(path => {
        res[path] = get(config, path)
      })
    } else if (paths.length === 1) {
      res = get(config, paths[0])
    } else {
      res = config
    }

    // @ts-ignore
    const output = toString(res, { verbose })
    console.log(highlight(output, { language: 'js' }))
  })
}
github KuangPF / vue-cli-analysis / packages / @vue / cli-service / lib / commands / inspect.js View on Github external
} else if (args.rules) {
      res = config.module.rules.map(r => r.__ruleNames[0])
    } else if (args.plugins) {
      res = config.plugins.map(p => p.__pluginName || p.constructor.name)
    } else if (paths.length > 1) {
      res = {}
      paths.forEach(path => {
        res[path] = get(config, path)
      })
    } else if (paths.length === 1) {
      res = get(config, paths[0])
    } else {
      res = config
    }
    // 根据参数 verbose 判断是否需要显示函数定义的内容,如果为 true,则用 function () { /* omitted long function */ } 代替函数的内容
    const output = toString(res, { verbose })
    console.log(output)
  })
}
github luoxue-victor / webpack-box / packages / webpack-box / build / inspect.js View on Github external
return name
    })
  } else if (args.plugins) {
    res = config.plugins.map(p => p.__pluginName || p.constructor.name)
  } else if (paths.length > 1) {
    res = {}
    paths.forEach(path => {
      res[path] = get(config, path)
    })
  } else if (paths.length === 1) {
    res = get(config, paths[0])
  } else {
    res = config
  }

  const output = toString(res, { verbose })
  console.log(highlight(output, { language: 'js' }))

  // Log explanation for Nameless Rules
  if (hasUnnamedRule) {
    console.log(`--- ${chalk.green('Footnotes')} ---`)
    console.log(`*: ${chalk.green(
          'Nameless Rules'
        )} were added through the ${chalk.green(
          'configureWebpack()'
        )} API (possibly by a plugin) instead of ${chalk.green(
          'chainWebpack()'
        )} (recommended).
    You can run ${chalk.green(
    'vue-cli-service inspect'
  )} without any arguments to inspect the full config and read these rules' config.`)
  }
github vuejs / vue-cli / packages / @vue / cli-service / lib / commands / inspect.js View on Github external
return name
        })
      } else if (args.plugins) {
        res = config.plugins.map(p => p.__pluginName || p.constructor.name)
      } else if (paths.length > 1) {
        res = {}
        paths.forEach(path => {
          res[path] = get(config, path)
        })
      } else if (paths.length === 1) {
        res = get(config, paths[0])
      } else {
        res = config
      }

      const output = toString(res, { verbose })
      console.log(highlight(output, { language: 'js' }))

      // Log explanation for Nameless Rules
      if (hasUnnamedRule) {
        console.log(`--- ${chalk.green('Footnotes')} ---`)
        console.log(`*: ${chalk.green(
          'Nameless Rules'
        )} were added through the ${chalk.green(
          'configureWebpack()'
        )} API (possibly by a plugin) instead of ${chalk.green(
          'chainWebpack()'
        )} (recommended).
    You can run ${chalk.green(
    'vue-cli-service inspect'
  )} without any arguments to inspect the full config and read these rules' config.`)
      }
github HuijiFE / void-ui / vue.config.js View on Github external
function output(config, filename) {
  fs.writeFile(
    filename,
    `module.exports = ${Config.toString(config.toConfig())}`,
    error => error && console.log(error),
  );
}
github neutrinojs / neutrino / packages / neutrino / src / inspect.js View on Github external
const inspectNew = config => Future.of(toString(config, { configPrefix }));
github egoist / poi / core / poi / lib / utils / WebpackChain.js View on Github external
toString(options) {
    return Chain.toString(this.toConfig(), options)
  }
}

webpack-chain

[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Build Status][travis-image]][travis-url]

MPL-2.0
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis

Popular webpack-chain functions