feat(config): migrate project configuration to smartconfig.json and update bundler dependencies
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsbundle',
|
||||
version: '2.9.3',
|
||||
version: '2.10.0',
|
||||
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ export class CustomBundleHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load configuration from npmextra.json
|
||||
* Load configuration from smartconfig.json
|
||||
*/
|
||||
public async loadConfig(): Promise<boolean> {
|
||||
const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd);
|
||||
this.config = npmextraInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
|
||||
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.cwd);
|
||||
this.config = smartconfigInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
|
||||
bundles: [],
|
||||
});
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class InitHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load existing npmextra.json or create empty config
|
||||
* Load existing smartconfig.json or create empty config
|
||||
*/
|
||||
private async loadExistingConfig(): Promise<any> {
|
||||
const fileExists = await plugins.fs.file(this.smartconfigPath).exists();
|
||||
@@ -60,7 +60,7 @@ export class InitHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Save config to npmextra.json
|
||||
* Save config to smartconfig.json
|
||||
*/
|
||||
private async saveConfig(config: any): Promise<void> {
|
||||
const content = JSON.stringify(config, null, 2);
|
||||
|
||||
@@ -53,7 +53,7 @@ export class TsBundleProcess {
|
||||
entryFileNames: outputFilename,
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
inlineDynamicImports: true,
|
||||
codeSplitting: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class TsBundleProcess {
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
minify: true,
|
||||
inlineDynamicImports: true,
|
||||
codeSplitting: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
||||
export { path };
|
||||
|
||||
// pushrocks scope
|
||||
import * as npmextra from '@push.rocks/smartconfig';
|
||||
import * as smartconfig from '@push.rocks/smartconfig';
|
||||
import * as smartcli from '@push.rocks/smartcli';
|
||||
import * as smartfs from '@push.rocks/smartfs';
|
||||
import * as smartinteract from '@push.rocks/smartinteract';
|
||||
@@ -15,7 +15,7 @@ import * as smartpromise from '@push.rocks/smartpromise';
|
||||
import * as smartspawn from '@push.rocks/smartspawn';
|
||||
|
||||
export {
|
||||
npmextra,
|
||||
smartconfig,
|
||||
smartcli,
|
||||
smartfs,
|
||||
smartinteract,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { runInit } from './mod_init/index.js';
|
||||
export const runCli = async () => {
|
||||
const tsBundleCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
// Default command: run custom bundles from npmextra.json
|
||||
// Default command: run custom bundles from smartconfig.json
|
||||
tsBundleCli.standardCommand().subscribe(async (argvArg) => {
|
||||
await runCustomBundles();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user