Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Dec 2, 2023
1 parent f764178 commit 565a411
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build-istanbul": "npx webpack --config mock/webpack.config-istanbul.js",
"build-v8": "npx webpack --config mock/webpack.config-v8.js",
"test": "node ./tests/test.js",
"build": "sf lint && sf b -p",
"build": "sf lint && sf b -p && npm run build-docs",
"dev": "sf d v8",
"build-docs": "node ./scripts/build-docs.js",
"patch": "npm run build && sf publish patch -r"
Expand Down Expand Up @@ -60,4 +60,4 @@
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
}
2 changes: 2 additions & 0 deletions scripts/build-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const Util = require('../lib/utils/util.js');

const buildDocs = () => {

console.log('build docs ...');

// copy css
const cssDir = path.resolve(__dirname, '../docs/assets');
if (!fs.existsSync(cssDir)) {
Expand Down
7 changes: 7 additions & 0 deletions scripts/conf.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const beforeV8 = (item, Util) => {
}

const jsPath = path.resolve(item.buildPath, dataFile);
const distDir = path.dirname(jsPath);
if (!fs.existsSync(distDir)) {
fs.mkdirSync(distDir, {
recursive: true
});
}

fs.copyFileSync(jsDataPath, jsPath);
EC.logGreen(`coverage data file copied: ${dataFile}`);

Expand Down

0 comments on commit 565a411

Please sign in to comment.