docs: function bundleAMD() {
      if (null == config.include_modules) {
          return;
      }
  
      const rjs    = require('requirejs');
      const srcmap = require('./srcmap');
      const BUILT_PATH = path.join(__dirname, '..', config.dir.built);
  
      const sourceNodes = [];
  
      const setSourceNode = (name, path, code) => {
          // ensure module name
          code = code
              .replace('define([', `define("${name}", [`)
              .replace(`define('${name}'`, `define("${name}"`)
              .replace(`define("${config.main.basename}",`, 'define(')
              .replace('define( [', 'define([')
          ;
  
          // create sourceNode from code.
          const node = srcmap.getNodeFromCode(code);
  
          // add shim chunk if special case.
          if (config.main.basename === name) {
              const shim = `// amd define function shim
  (function (root) {
      if (!(typeof define === "function" && define.amd)) {
          root.define = function () { /* noop */ };
      }
  })(this);
  `;
              node.prepend(shim + '\n');
          }
  
          // cache node
          sourceNodes.push(node);
          return node.toString();
      };
  
      const options = {
          preserveLicenseComments: true,
          baseUrl: config.dir.built,
          name: config.main.basename,
          include: (() => {
              const modules = [];
              config.include_modules.forEach(function (target) {
                  modules.push(target.replace(/-/g, '.'));
              });
              return modules;
          })(),
          paths: {
              'jquery': 'empty:',
              'underscore': 'empty:',
              'backbone': 'empty:',
          },
          out: `${config.dir.built}/${config.main.basename}-all.js`,
          optimize: 'none',
          onBuildWrite: function (name, path, contents) {
              return setSourceNode(name, path, contents);
          }
      };
  
      // rename: {basename}-all.js -> {basename}.js
      fs.writeFileSync(
          path.join(BUILT_PATH, `${config.main.basename}.js`),
          fs.readFileSync(path.join(BUILT_PATH, `${config.main.basename}-all.js`)).toString()
      );
  
      // copy modules
      const srcPath = path.join(__dirname, '..', config.dir.external, 'cdp', config.dir.script);
      fs.readdirSync(srcPath)
      .forEach((file) => {
          const src = path.join(srcPath, file);
          if (fs.statSync(src).isFile()) {
              const dst = path.join(BUILT_PATH, file);
              fs.writeFileSync(dst, fs.readFileSync(src).toString());
          }
      });
  
      // bundle
      rjs.optimize(
          options,
          () => {
              const node = generateBannerNode();
              sourceNodes.forEach((srcnode) => {
                  node.add(srcnode);
              });
  
              const script = srcmap.getCodeFromNode(node, (source) => {
                  return source
                      .replace(`../${config.dir.src}/${config.dir.script}`, `${config.main.namespace}:///exports:/`)
                      .replace('webpack:/webpack', 'webpack:///webpack')
                      .replace('webpack:/external', 'webpack:///external')
                  ;
              });
              fs.writeFileSync(
                  path.join(BUILT_PATH, `${config.main.basename}.js`),
                  script
              );
              fs.writeFileSync(
                  path.join(DST_PATH, `${config.main.basename}.js`),
                  script
              );
          }
      );
  }