@tanstack/start-plugin-core 1.169.0 → 1.169.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/rsbuild/normalized-client-build.js +9 -1
- package/dist/esm/rsbuild/normalized-client-build.js.map +1 -1
- package/dist/esm/rsbuild/plugin.js +4 -1
- package/dist/esm/rsbuild/plugin.js.map +1 -1
- package/dist/esm/rsbuild/schema.d.ts +8 -0
- package/dist/esm/rsbuild/virtual-modules.js +14 -13
- package/dist/esm/rsbuild/virtual-modules.js.map +1 -1
- package/dist/esm/schema.d.ts +25 -0
- package/dist/esm/schema.js +4 -1
- package/dist/esm/schema.js.map +1 -1
- package/dist/esm/start-manifest-plugin/inlineCss.d.ts +6 -0
- package/dist/esm/start-manifest-plugin/inlineCss.js +59 -0
- package/dist/esm/start-manifest-plugin/inlineCss.js.map +1 -0
- package/dist/esm/start-manifest-plugin/manifestBuilder.d.ts +4 -0
- package/dist/esm/start-manifest-plugin/manifestBuilder.js +33 -3
- package/dist/esm/start-manifest-plugin/manifestBuilder.js.map +1 -1
- package/dist/esm/types.d.ts +1 -0
- package/dist/esm/vite/planning.d.ts +3 -0
- package/dist/esm/vite/planning.js +1 -0
- package/dist/esm/vite/planning.js.map +1 -1
- package/dist/esm/vite/plugin.js +1 -0
- package/dist/esm/vite/plugin.js.map +1 -1
- package/dist/esm/vite/schema.d.ts +8 -0
- package/dist/esm/vite/start-manifest-plugin/normalized-client-build.js +11 -1
- package/dist/esm/vite/start-manifest-plugin/normalized-client-build.js.map +1 -1
- package/dist/esm/vite/start-manifest-plugin/plugin.js +2 -1
- package/dist/esm/vite/start-manifest-plugin/plugin.js.map +1 -1
- package/package.json +8 -7
- package/src/rsbuild/normalized-client-build.ts +14 -0
- package/src/rsbuild/plugin.ts +7 -0
- package/src/rsbuild/virtual-modules.ts +15 -5
- package/src/schema.ts +6 -0
- package/src/start-manifest-plugin/inlineCss.ts +93 -0
- package/src/start-manifest-plugin/manifestBuilder.ts +76 -6
- package/src/types.ts +1 -0
- package/src/vite/planning.ts +5 -0
- package/src/vite/plugin.ts +2 -0
- package/src/vite/start-manifest-plugin/normalized-client-build.ts +19 -0
- package/src/vite/start-manifest-plugin/plugin.ts +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tsrSplit } from '@tanstack/router-plugin'
|
|
2
|
+
import { getCssAssetSource } from '../../start-manifest-plugin/inlineCss'
|
|
2
3
|
import type { Rollup } from 'vite'
|
|
3
4
|
import type { NormalizedClientBuild, NormalizedClientChunk } from '../../types'
|
|
4
5
|
|
|
@@ -40,6 +41,7 @@ export function normalizeViteClientBuild(
|
|
|
40
41
|
const chunksByFileName = normalizeViteClientChunks(clientBundle)
|
|
41
42
|
const chunkFileNamesByRouteFilePath = new Map<string, Array<string>>()
|
|
42
43
|
const cssFilesBySourcePath = new Map<string, Array<string>>()
|
|
44
|
+
const cssContentByFileName = new Map<string, string>()
|
|
43
45
|
|
|
44
46
|
for (const chunk of chunksByFileName.values()) {
|
|
45
47
|
const bundleEntry = clientBundle[chunk.fileName] as Rollup.OutputChunk
|
|
@@ -78,6 +80,22 @@ export function normalizeViteClientBuild(
|
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
|
|
83
|
+
for (const fileName in clientBundle) {
|
|
84
|
+
if (!fileName.endsWith('.css')) {
|
|
85
|
+
continue
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const bundleEntry = clientBundle[fileName]!
|
|
89
|
+
if (bundleEntry.type !== 'asset') {
|
|
90
|
+
continue
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const css = getCssAssetSource(bundleEntry.source)
|
|
94
|
+
if (css !== undefined) {
|
|
95
|
+
cssContentByFileName.set(fileName, css)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
81
99
|
if (!entryChunkFileName) {
|
|
82
100
|
throw new Error('No entry file found')
|
|
83
101
|
}
|
|
@@ -87,6 +105,7 @@ export function normalizeViteClientBuild(
|
|
|
87
105
|
chunksByFileName,
|
|
88
106
|
chunkFileNamesByRouteFilePath,
|
|
89
107
|
cssFilesBySourcePath,
|
|
108
|
+
cssContentByFileName,
|
|
90
109
|
}
|
|
91
110
|
}
|
|
92
111
|
|
|
@@ -44,7 +44,7 @@ export function startManifestPlugin(opts: {
|
|
|
44
44
|
moduleId: VIRTUAL_MODULES.startManifest,
|
|
45
45
|
enforce: 'pre',
|
|
46
46
|
load() {
|
|
47
|
-
const { resolvedStartConfig } = opts.getConfig()
|
|
47
|
+
const { resolvedStartConfig, startConfig } = opts.getConfig()
|
|
48
48
|
const clientEntry = joinURL(
|
|
49
49
|
resolvedStartConfig.basePaths.publicBase,
|
|
50
50
|
'@id',
|
|
@@ -70,6 +70,7 @@ export function startManifestPlugin(opts: {
|
|
|
70
70
|
clientBuild,
|
|
71
71
|
routeTreeRoutes,
|
|
72
72
|
basePath: resolvedStartConfig.basePaths.publicBase,
|
|
73
|
+
inlineCss: startConfig.server.build.inlineCss,
|
|
73
74
|
additionalRouteAssets: getViteAdditionalRouteAssets({
|
|
74
75
|
cssCodeSplitDisabledFileName,
|
|
75
76
|
basePath: resolvedStartConfig.basePaths.publicBase,
|