UNPKG

kef-builder-buffet

Version:

buffet-builder构建工具

24 lines (19 loc) 747 B
'use strict'; const path = require('path'); const getAllPages = require('../../utils/getAllPages'); const ENV = require('../../utils/env'); const CONST = require('../../utils/const'); const getEntry = require('../../utils/getEntry'); module.exports = function (config, argv) { let entries = config.entry || {}; entries = getEntry(CONST.abcData); Object.keys(entries).forEach(function (entryKey) { let entryPath = entries[entryKey]; // dev的时候打开增加 hotMiddlewareScript 入口 if (ENV.BUILD_DEBUG) { let hotMiddlewareScript = 'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true'; entries[entryKey] = [hotMiddlewareScript, entryPath]; } }); config.entry = entries; }