lundi 10 mai 2021

got stuck while loading when returning a successful promise

I registered a command, and build is to find entry in the parameter, thereafter running webpack:

module.exports = (api, options) => {
  api.registerCommand(name: 'pd-build', opts: {
    description: 'build for production',
    usage: 'vue-cli-service pd-build [options] [entry|pattern]',
    options: {'--mode': `specify env mode (default: production)`...}
  }, fn: async (args, rawArgs) => {
    for (const key in defaults) {
      if (args[key] == null) {
        args[key] = defaults[key]
      }
    }
    args.entry = args.entry || args._[0] 'src/App.vue'

  process.env.VUE_CLI_BUILD_TARGET = 'lib'
  await build(args, api, options)
  console.log(1)
  delete process.env.VUE_CLI_BUILD_TARGET
})

I wrote:

if (Object.keys(webpackConfig[0].entry).length) {
  validateWebpackConfig(webpackConfig, api, options, target:'lib'))
  if (args.watch) {...}

considering there might be no entry here. It just returns a successful promise via else, just resolve after succeeding in if...

but it got stuck here. any reasons why?




Aucun commentaire:

Enregistrer un commentaire