Skip to content

Commit

Permalink
fix: config should in config dile
Browse files Browse the repository at this point in the history
  • Loading branch information
xiefengnian committed Dec 9, 2021
1 parent 3258bc8 commit 3319dd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/father-build/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ export async function build(opts: IOpts, extraOpts: IExtraBuildOpts = {}) {
const { cwd, rootPath, watch, buildArgs = {} } = opts;
const { pkg } = extraOpts;

const outputDir = opts.buildArgs.output || 'dist';

const dispose: Dispose[] = [];

const customConfigPath =
Expand Down Expand Up @@ -147,6 +145,8 @@ export async function build(opts: IOpts, extraOpts: IExtraBuildOpts = {}) {
for (const bundleOpts of bundleOptsArray) {
validateBundleOpts(bundleOpts, { cwd, rootPath });

const outputDir = '' + (bundleOpts.output || 'dist');

// Clean dist
log(chalk.gray(`Clean ${outputDir} directory`));
rimraf.sync(join(cwd, outputDir));
Expand Down
22 changes: 8 additions & 14 deletions packages/father-build/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
type: 'object',
additionalProperties: false,
properties: {
output: { type: 'string' },
entry: {
oneOf: [noEmptyStr, { type: 'array', items: noEmptyStr }],
},
Expand All @@ -26,7 +27,7 @@ export default {
importLibToEs: {
type: 'boolean',
},
dir: noEmptyStr
dir: noEmptyStr,
},
},
],
Expand Down Expand Up @@ -64,8 +65,8 @@ export default {
sourcemap: {
oneOf: [
{ type: 'boolean' },
{ type: 'string', pattern: '^(inline|hidden)$', },
]
{ type: 'string', pattern: '^(inline|hidden)$' },
],
},
},
},
Expand Down Expand Up @@ -102,11 +103,7 @@ export default {
type: 'object',
},
include: {
oneOf: [
{ type: 'string' },
{ type: 'object' },
{ type: 'array' },
]
oneOf: [{ type: 'string' }, { type: 'object' }, { type: 'array' }],
},
runtimeHelpers: {
type: 'boolean',
Expand All @@ -128,16 +125,13 @@ export default {
type: 'object',
},
lessInRollupMode: {
type: 'object'
type: 'object',
},
sassInRollupMode: {
type: 'object'
type: 'object',
},
lessInBabelMode: {
oneOf: [
{ type: 'boolean' },
{ type: 'object' },
],
oneOf: [{ type: 'boolean' }, { type: 'object' }],
},
browserFiles: {
type: 'array',
Expand Down

0 comments on commit 3319dd0

Please sign in to comment.