Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修复 watch 状态下删除 dist 目录导致小程序本身构建进程奔溃的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Aug 31, 2019
1 parent 49e8d34 commit 921846d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/remax-cli/src/build/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ export default function rollupConfig(
const cssModuleConfig = getCssModuleConfig(options.cssModules);

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

if (process.env.NODE_ENV === 'production') {
plugins.unshift(
clean({
targets: ['dist/*', '!.tea'],
})
);
}

const config: RollupOptions = {
input: [entries.app, ...entries.pages.map(p => p.file), ...entries.images],
output: {
Expand Down

0 comments on commit 921846d

Please sign in to comment.