forked from external-repos/squoosh
Much simpler project structure
This commit is contained in:
@@ -59,23 +59,7 @@ export default function () {
|
||||
.flat(Infinity)
|
||||
.join('\n');
|
||||
|
||||
const workerTsConfig = {
|
||||
extends: '../../generic-tsconfig.json',
|
||||
compilerOptions: {
|
||||
lib: ['webworker', 'esnext'],
|
||||
},
|
||||
references: featuresWorkerTsNames.map(([tsImport]) => ({
|
||||
path: path.dirname(tsImport),
|
||||
})),
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
fsp.writeFile(
|
||||
path.join(workerBasePath, 'tsconfig.json'),
|
||||
autoGenComment + JSON.stringify(workerTsConfig, null, ' '),
|
||||
),
|
||||
fsp.writeFile(path.join(workerBasePath, 'index.ts'), workerFile),
|
||||
]);
|
||||
await fsp.writeFile(path.join(workerBasePath, 'index.ts'), workerFile);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +155,6 @@ export default function () {
|
||||
'lazy-app',
|
||||
'feature-meta',
|
||||
);
|
||||
const clientBasePath = path.join(process.cwd(), 'src', 'client');
|
||||
|
||||
const joinedMetas = metas.flat().join();
|
||||
|
||||
@@ -194,13 +177,6 @@ export default function () {
|
||||
const preprocessorMetaTsNames = preprocessorMetas.map((tsImport) =>
|
||||
getTsName(tsImport),
|
||||
);
|
||||
const tsConfigEncoderPaths = encoderMetas.flatMap((tsImport) => [
|
||||
path.relative(clientBasePath, tsImport.replace(/\/meta$/, '')),
|
||||
path.relative(
|
||||
clientBasePath,
|
||||
tsImport.replace(/shared\/meta$/, 'client'),
|
||||
),
|
||||
]);
|
||||
|
||||
const featureMeta = [
|
||||
autoGenComment,
|
||||
@@ -267,29 +243,10 @@ export default function () {
|
||||
.flat(Infinity)
|
||||
.join('\n');
|
||||
|
||||
const lazyTsConfig = {
|
||||
extends: '../../generic-tsconfig.json',
|
||||
compilerOptions: {
|
||||
lib: ['esnext', 'dom', 'dom.iterable'],
|
||||
types: [],
|
||||
},
|
||||
references: [
|
||||
{ path: '../features-worker' },
|
||||
{ path: '../shared' },
|
||||
{ path: '../features/processors/resize/client' },
|
||||
...tsConfigEncoderPaths.map((projectPath) => ({
|
||||
path: projectPath,
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
fsp.writeFile(
|
||||
path.join(process.cwd(), 'src', 'client', 'tsconfig.json'),
|
||||
autoGenComment + JSON.stringify(lazyTsConfig, null, ' '),
|
||||
),
|
||||
fsp.writeFile(path.join(featureMetaBasePath, 'index.ts'), featureMeta),
|
||||
]);
|
||||
await fsp.writeFile(
|
||||
path.join(featureMetaBasePath, 'index.ts'),
|
||||
featureMeta,
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user