docs: function compileWxml(compiled, html) {
      if (!emitHookAdded) {
          emitHookAdded = true;
          this._compilation.plugin('seal', () => {
              const roots = Object.keys(emitQueue)
                  .filter(k => emitQueue[k].isRoot)
                  .map(k => emitQueue[k]);
              const slots = getSlotsWithoutImports();
              roots.forEach(root => {
                  this.emitFile(`${root.path}.${root.type}`, combineWxml(root.name));
              });
  
              emitHookAdded = false;
          });
          this._compilation.plugin('after-optimize-chunk-assets', chunks => {
              const entries = Object.keys(this.options.entry).map(k => `components/${k}/${k}.js`);
              chunks.forEach(chunk => {
                  chunk.files.forEach(file => {
                      if (entries.indexOf(file) > -1) {
                          this._compilation.assets[file] = new ConcatSource(
                              "require('../common/common.js');",
                              '\n',
                              this._compilation.assets[file]
                          );
                      }
                  });
              });
          });
      }
  
      if (!slotsHookAdded) {
          // avoid add hook several times during compilation
          slotsHookAdded = true;
          // TODO: support webpack4
          this._compilation.plugin('seal', () => {
              // const tpls = Object.keys(emitQueue)
              //     .filter(k => !emitQueue[k].isRoot)
              //     .reverse()
              //     .map(k => emitQueue[k])
              //     .reduce((prev, curr) => {
              //         return prev + curr.code + '\r\n';
              //     }, '');
              // const content = getSlots();
              // console.log('slots', content);
              // const content = tpls;
              // if (content.trim()) {
              //     this.emitFile('components/slots.wxml', htmlBeautify(content));
              // }
              // reset flag after slots file emited
              slotsHookAdded = false;
          });
      }
      return new Promise(resolve => {
          const pollComponentsStatus = () => {
              const { pageType, components } = getFileInfo(this.resourcePath) || {};
              if (!pageType || (components && !components.isCompleted)) {
                  setTimeout(pollComponentsStatus, 20);
              } else {
                  resolve();
              }
          };
          pollComponentsStatus();
      }).then(() => {
          createWxml(this.emitWarning, this.emitError, this.emitFile, this.resourcePath, null, compiled, html);
      });
  }