mirror of
https://github.com/klinecharts/KLineChart.git
synced 2024-11-25 16:22:43 +08:00
ci: ci log
This commit is contained in:
parent
bbef07d50d
commit
dba0127f28
@ -39,7 +39,7 @@
|
||||
"build-core:dev": "cross-env NODE_ENV=development node scripts/build.cjs",
|
||||
"build-core:prod": "cross-env NODE_ENV=production node scripts/build.cjs",
|
||||
"build-core": "npm run build-core:dev && npm run build-core:prod",
|
||||
"build-dts": "dts-bundle-generator --no-banner true --umd-module-name klinecharts -o types/index.d.ts src/index.ts",
|
||||
"build-dts": "dts-bundle-generator --no-banner true --fail-on-class true --umd-module-name klinecharts -o types/index.d.ts src/index.ts",
|
||||
"build": "npm run clean && npm run build-core && npm run build-dts",
|
||||
"prepare": "husky install",
|
||||
"docs:pre-work": "npm run pre-work --prefix docs",
|
||||
@ -68,7 +68,7 @@
|
||||
"chalk": "^4.1.2",
|
||||
"codesandbox": "^2.2.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"dts-bundle-generator": "^7.0.0",
|
||||
"dts-bundle-generator": "^9.0.0",
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-config-standard-with-typescript": "^22.0.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
|
@ -4,13 +4,15 @@ const rollup = require('rollup');
|
||||
|
||||
const chalk = require('chalk');
|
||||
|
||||
const { inputConfig, outputConfig } = require('./config.cjs');
|
||||
const { inputConfig, outputConfig, version } = require('./config.cjs');
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
|
||||
async function build() {
|
||||
const fileName = env === 'development' ? 'klinecharts.js' : 'klinecharts.min.js'
|
||||
console.log(`Creating an optimized ${chalk.blue(`${fileName}`)} build...\n`);
|
||||
|
||||
const fileNameVersion = `v${version} ${fileName}`
|
||||
console.log(`Creating an optimized version ${chalk.blue(fileNameVersion)} build...\n`);
|
||||
const input = inputConfig(env);
|
||||
|
||||
try {
|
||||
@ -20,11 +22,11 @@ async function build() {
|
||||
const output = outputConfig(env, fileName);
|
||||
await bundle.write(output);
|
||||
|
||||
console.log(chalk.green(`\n✔️ Compiled ${fileName} successfully.\n`));
|
||||
console.log(chalk.green(`\n✔️ Compiled ${fileNameVersion} successfully.\n`));
|
||||
console.log(`Done in ${((new Date().getTime() - startTime) / 1000 / 60).toFixed(2)}s.\n`)
|
||||
} catch (err) {
|
||||
console.log(`\n\n${chalk.red(err)}\n`);
|
||||
console.log(chalk.red(`✖️ Failed to compile ${fileName}.\n`));
|
||||
console.log(chalk.red(`✖️ Failed to compile ${fileNameVersion}.\n`));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -64,5 +64,6 @@ function outputConfig (env, fileName) {
|
||||
|
||||
module.exports = {
|
||||
inputConfig,
|
||||
outputConfig
|
||||
outputConfig,
|
||||
version
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user