code: function createModuleConfig(options) {
    return {
      strictExportPresence: true,
      rules: [// Disable require.ensure as it's not a standard language feature.
      {
        parser: {
          requireEnsure: false
        }
      }, // tsx? / jsx?
      {
        test: options.typescript ? /\.[tj]sx?$/ : /\.jsx?$/,
        include: [path.resolve(options.paths.src), ...options.includeModules.map(includeModule => {
          const packageJson = findUp.sync('package.json', {
            cwd: path.dirname( // requireFromPwd.resolve(includeModule)
            fs.realpathSync(resolveFrom(process.cwd(), includeModule)))
          });
          if (!packageJson) return;
          return packageJson.slice(0, -12);
        }).filter(Boolean), ...options.includePaths],
        loaders: [{
          loader: require.resolve('babel-loader'),
          options: {
            babelrc: false,
            cacheDirectory: true,
            ...options.babel
          }
        }, ...(options.jsLoaders || [])]
      }, // other rules
      ...(options.moduleRules || [])]
    };
  }
docs: with node 10.12 import { createRequireFromPath } from 'module'; const requireFromPwd = createRequireFromPath(process.cwd());