Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开发cli插件,有没有异步执行的api #4305

Open
HCLQ opened this issue Jul 18, 2019 · 1 comment
Open

开发cli插件,有没有异步执行的api #4305

HCLQ opened this issue Jul 18, 2019 · 1 comment

Comments

@HCLQ
Copy link

HCLQ commented Jul 18, 2019

What problem does this feature solve?

开发vue-cli插件,希望能有个异步执行api, 执行每个插件的异步任务,完成后再执行webpaclk编译等后续操作

What does the proposed API look like?

想umi的插件api里 _beforeDevServerAsync类似

api.register('_beforeDevServerAsync', () => {
    return new Promise((resolve, reject) => {
      buildDll()
        .then(() => {
          resolve();
        })
        .catch(e => {
          reject(e);
        });
    });
  });

@HCLQ
Copy link
Author

HCLQ commented Jul 19, 2019

想要在serve和build前先自动打包dll
看来只有注册新命令,执行完dll后,api.service.run('build')这样了么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants