feat(core): Integrate Rolldown as optional bundler, migrate filesystem to smartfs, and update bundler/tooling
This commit is contained in:
@@ -11,10 +11,16 @@ export class TsBundleProcess {
|
||||
public async getAliases() {
|
||||
try {
|
||||
const aliasObject: Record<string, string> = {};
|
||||
const localTsConfig = plugins.smartfile.fs.toObjectSync(
|
||||
plugins.path.join(paths.cwd, 'tsconfig.json')
|
||||
);
|
||||
if (localTsConfig.compilerOptions && localTsConfig.compilerOptions.paths) {
|
||||
const tsconfigPath = plugins.path.join(paths.cwd, 'tsconfig.json');
|
||||
const tsconfigContent = await plugins.fs
|
||||
.file(tsconfigPath)
|
||||
.encoding('utf8')
|
||||
.read();
|
||||
const localTsConfig = JSON.parse(tsconfigContent as string);
|
||||
if (
|
||||
localTsConfig.compilerOptions &&
|
||||
localTsConfig.compilerOptions.paths
|
||||
) {
|
||||
for (const alias of Object.keys(localTsConfig.compilerOptions.paths)) {
|
||||
const aliasPath = localTsConfig.compilerOptions.paths[alias][0];
|
||||
aliasObject[alias] = aliasPath;
|
||||
@@ -75,7 +81,7 @@ export class TsBundleProcess {
|
||||
const run = async () => {
|
||||
console.log('running spawned compilation process');
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(
|
||||
process.env.transportOptions
|
||||
process.env.transportOptions,
|
||||
);
|
||||
console.log('=======> ESBUILD');
|
||||
console.log(transportOptions);
|
||||
@@ -85,16 +91,28 @@ const run = async () => {
|
||||
if (transportOptions.mode === 'test') {
|
||||
console.log('building for test:');
|
||||
tsbundleProcessInstance.buildTest(
|
||||
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
||||
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
||||
transportOptions.argv
|
||||
plugins.smartpath.transform.makeAbsolute(
|
||||
transportOptions.from,
|
||||
process.cwd(),
|
||||
),
|
||||
plugins.smartpath.transform.makeAbsolute(
|
||||
transportOptions.to,
|
||||
process.cwd(),
|
||||
),
|
||||
transportOptions.argv,
|
||||
);
|
||||
} else {
|
||||
console.log('building for production:');
|
||||
tsbundleProcessInstance.buildProduction(
|
||||
plugins.smartpath.transform.makeAbsolute(transportOptions.from, process.cwd()),
|
||||
plugins.smartpath.transform.makeAbsolute(transportOptions.to, process.cwd()),
|
||||
transportOptions.argv
|
||||
plugins.smartpath.transform.makeAbsolute(
|
||||
transportOptions.from,
|
||||
process.cwd(),
|
||||
),
|
||||
plugins.smartpath.transform.makeAbsolute(
|
||||
transportOptions.to,
|
||||
process.cwd(),
|
||||
),
|
||||
transportOptions.argv,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,6 +2,4 @@ export * from '../plugins.js';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
|
||||
export {
|
||||
esbuild
|
||||
}
|
||||
export { esbuild };
|
||||
|
||||
Reference in New Issue
Block a user