Skip to content

Commit

Permalink
chore(rollup): update clear dist
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqiboy committed Mar 26, 2020
1 parent 464c6a4 commit d8ed897
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"entryFile": "src/index.js",
"scripts": {
"start": "cd docs && npm start",
"build": "rollup -c",
"build": "npm run clear && rollup -c",
"clear": "rimraf dist",
"test": "node jest/test.js -c jest/jest.config.js"
},
"repository": {
Expand Down
4 changes: 1 addition & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
process.env.NODE_ENV = 'production';

const path = require('path');
const fs = require('fs-extra');
const fs = require('fs');
const commonjs = require('@rollup/plugin-commonjs');
const replace = require('@rollup/plugin-replace');
const nodeResolve = require('@rollup/plugin-node-resolve');
Expand Down Expand Up @@ -162,8 +162,6 @@ function createConfig(env, module) {
};
}

fs.emptyDirSync('dist');

module.exports = ['cjs', 'esm', 'umd'].reduce((configQueue, module) => {
return fs.existsSync(`./npm/index.${module}.js`)
? configQueue.concat(createConfig('development', module), createConfig('production', module))
Expand Down

0 comments on commit d8ed897

Please sign in to comment.