mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
chore: log build time, minimize in production
This commit is contained in:
@@ -98,7 +98,9 @@ require('yargs')
|
||||
async function build() {
|
||||
const config = createRollupConfig()
|
||||
for (const moduleConfig of config) {
|
||||
console.log(`Building ${packageName} ${moduleConfig.output.dir}`);
|
||||
const module = moduleConfig.output.dir.replace('dist' , '')
|
||||
const start = Date.now()
|
||||
console.log(`Building ${packageName}${module}`);
|
||||
try {
|
||||
const bundle = await rollup.rollup(moduleConfig);
|
||||
await bundle.write(moduleConfig.output);
|
||||
@@ -106,7 +108,8 @@ require('yargs')
|
||||
console.error(e)
|
||||
process.exitCode = 1;
|
||||
} finally {
|
||||
console.log(`Build finished ${packageName} ${moduleConfig.output.dir}`);
|
||||
const buildTime = Math.floor((Date.now() - start) / 1000);
|
||||
console.log(`Build finished ${packageName}${module}, ${buildTime} s`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,6 +146,7 @@ require('yargs')
|
||||
},
|
||||
},
|
||||
function (argv) {
|
||||
const start = Date.now()
|
||||
const webpackArgv = createWebpackArgv(argv);
|
||||
// console.log(webpackArgv)
|
||||
const configObject = buildConfig({}, webpackArgv)
|
||||
@@ -150,6 +154,8 @@ require('yargs')
|
||||
|
||||
compiler.run((err, stats) => {
|
||||
console.log(stats.compilation.errors)
|
||||
const buildTime = Math.floor((Date.now() - start) / 1000);
|
||||
console.log(`Build app finished in ${buildTime} s`);
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
@@ -12,11 +12,11 @@ module.exports = (env, argv) => merge(commonConfig(env, argv), {
|
||||
path: path.resolve(argv.currentDir, './dist'),
|
||||
publicPath: '',
|
||||
},
|
||||
devtool: 'source-map',
|
||||
devtool: argv.mode === 'production' ? false : 'source-map',
|
||||
plugins: [],
|
||||
optimization: {
|
||||
minimize: false,
|
||||
namedModules: true,
|
||||
concatenateModules: false,
|
||||
minimize: argv.mode === 'production',
|
||||
namedModules: argv.mode !== 'production',
|
||||
concatenateModules: argv.mode === 'production',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
"scripts": {
|
||||
"lint": "eslint ./src/ --ext .ts,.tsx"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@dbeaver/core": "^0.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/cli": "^7.7.4",
|
||||
"@babel/core": "^7.7.4",
|
||||
@@ -22,6 +19,7 @@
|
||||
"@babel/preset-react": "^7.7.4",
|
||||
"@babel/preset-typescript": "^7.7.4",
|
||||
"@csstools/postcss-sass": "^4.0.0",
|
||||
"@dbeaver/core": "^0.1.0",
|
||||
"@material/button": "^4.0.0",
|
||||
"@material/elevation": "^4.0.0",
|
||||
"@material/ripple": "^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user