cli: switch experimental /auth entry to index-public-experimental at /public instead

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-01-23 13:39:48 +01:00
parent 9b7c6c8dd5
commit f518683b97
4 changed files with 19 additions and 19 deletions
+10 -10
View File
@@ -61,20 +61,20 @@ export async function buildBundle(options: BuildOptions) {
}),
];
const authPaths = await resolveOptionalBundlingPaths({
entry: 'src/auth',
dist: 'dist/auth',
const publicPaths = await resolveOptionalBundlingPaths({
entry: 'src/index-public-experimental',
dist: 'dist/public',
});
if (authPaths) {
if (publicPaths) {
console.log(
chalk.yellow(
`⚠️ WARNING: The app /auth entry point is an experimental feature that may receive immediate breaking changes.`,
),
);
configs.push(
await createConfig(authPaths, {
await createConfig(publicPaths, {
...commonConfigOptions,
publicSubPath: '/auth',
publicSubPath: '/public',
}),
);
}
@@ -82,8 +82,8 @@ export async function buildBundle(options: BuildOptions) {
const isCi = yn(process.env.CI, { default: false });
const previousFileSizes = await measureFileSizesBeforeBuild(paths.targetDist);
const previousAuthSizes = authPaths
? await measureFileSizesBeforeBuild(authPaths.targetDist)
const previousAuthSizes = publicPaths
? await measureFileSizesBeforeBuild(publicPaths.targetDist)
: undefined;
await fs.emptyDir(paths.targetDist);
@@ -124,11 +124,11 @@ export async function buildBundle(options: BuildOptions) {
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE,
);
if (authPaths && previousAuthSizes) {
if (publicPaths && previousAuthSizes) {
printFileSizesAfterBuild(
authStats,
previousAuthSizes,
authPaths.targetDist,
publicPaths.targetDist,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE,
);
+8 -8
View File
@@ -203,23 +203,23 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be
root: paths.targetPath,
});
} else {
const authPaths = await resolveOptionalBundlingPaths({
entry: 'src/auth',
dist: 'dist/auth',
const publicPaths = await resolveOptionalBundlingPaths({
entry: 'src/index-public-experimental',
dist: 'dist/public',
});
if (authPaths) {
if (publicPaths) {
console.log(
chalk.yellow(
`⚠️ WARNING: The app /auth entry point is an experimental feature that may receive immediate breaking changes.`,
`⚠️ WARNING: The app /public entry point is an experimental feature that may receive immediate breaking changes.`,
),
);
}
const compiler = authPaths
const compiler = publicPaths
? webpack([
config,
await createConfig(authPaths, {
await createConfig(publicPaths, {
...commonConfigOptions,
publicSubPath: '/auth',
publicSubPath: '/public',
}),
])
: webpack(config);
+1 -1
View File
@@ -26,7 +26,7 @@ export type BundlingOptions = {
baseUrl: URL;
parallelism?: number;
additionalEntryPoints?: string[];
// Path to append to the detected public path, e.g. '/auth'
// Path to append to the detected public path, e.g. '/public'
publicSubPath?: string;
};