Skip to content

Commit

Permalink
build: build前清理输出目录,并保留.tea不删除
Browse files Browse the repository at this point in the history
resolve remaxjs#132
  • Loading branch information
Darmody authored and yesmeck committed Aug 25, 2019
1 parent fbc7354 commit a98ed9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/remax-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-copy": "^3.1.0",
"rollup-plugin-delete": "^1.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.3",
"rollup-plugin-progress": "^1.1.1",
Expand Down
13 changes: 4 additions & 9 deletions packages/remax-cli/src/build/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import url from 'rollup-plugin-url';
import json from 'rollup-plugin-json';
import postcss from '@meck/rollup-plugin-postcss';
import progress from 'rollup-plugin-progress';
import clear from 'rollup-plugin-clear';
import clean from 'rollup-plugin-delete';
import alias from 'rollup-plugin-alias';
import copy from 'rollup-plugin-copy';
import stub from './plugins/stub';
Expand Down Expand Up @@ -72,6 +72,9 @@ export default function rollupConfig(
const cssModuleConfig = getCssModuleConfig(options.cssModules);

const plugins = [
clean({
targets: ['dist/*', '!.tea'],
}),
copy({
targets: [
{
Expand Down Expand Up @@ -214,14 +217,6 @@ export default function rollupConfig(
plugins.push(progress());
}

if (!argv.watch) {
plugins.unshift(
clear({
targets: options.output,
})
);
}

const config: RollupOptions = {
input: [entries.app, ...entries.pages.map(p => p.file)],
output: {
Expand Down
2 changes: 1 addition & 1 deletion packages/remax-cli/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare module '@meck/rollup-plugin-postcss';
declare module 'rollup-plugin-json';
declare module 'rollup-plugin-node-resolve';
declare module 'rollup-plugin-progress';
declare module 'rollup-plugin-clear';
declare module 'rollup-plugin-delete';
declare module 'rollup-plugin-alias';
declare module 'rollup-plugin-url';
declare module 'rollup-plugin-typescript';
Expand Down

0 comments on commit a98ed9d

Please sign in to comment.