Skip to content

Commit

Permalink
show warning if user use .umirc.library.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed May 31, 2019
1 parent 4f1f5e7 commit e96662c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/getUserConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync } from 'fs';
import AJV from 'ajv';
import slash from 'slash2';
import { relative } from 'path';
import signale from 'signale';
import schema from './schema';
import { getExistFile } from './utils';
import { IBundleOptions } from './types';
Expand All @@ -28,7 +28,11 @@ export default function({ cwd }): IBundleOptions {
returnRelative: false,
});

if (existsSync(configFile)) {
if (configFile) {
if (configFile.includes('.umirc.library.')) {
signale.warn(`Please use .fatherrc.js instead of .umirc.library.js`);
}

const userConfig = testDefault(require(configFile)); // eslint-disable-line
const ajv = new AJV({ allErrors: true });
const isValid = ajv.validate(schema, userConfig);
Expand Down

0 comments on commit e96662c

Please sign in to comment.