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:
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user