UNPKG

ae-biu

Version:

Born For AE, Born To Do

23 lines (20 loc) 536 B
// @flow // put here for valid eslint require('babel-register') const { workDir } = require('./paths') const { existsSync } = require('fs') const { resolve } = require('path') export default () => { const paths = ['webpack.config.babel.js', 'webpack.config.js', 'webpack.js'] let webpackPath = '' for (let i = 0; i < paths.length; i++) { const filePath = resolve(workDir, paths[i]) if (existsSync(filePath)) { webpackPath = filePath break } } if (webpackPath) { return require(webpackPath) } }