@brillout/vite-plugin-server-entry
Advanced tools
Comparing version 0.4.1-commit-4182176 to 0.4.1-commit-fa4cb7a
@@ -18,3 +18,3 @@ "use strict"; | ||
const virtualIdPrefix = '\0'; | ||
const apiVersion = 3; | ||
const apiVersion = 4; | ||
/** | ||
@@ -38,2 +38,3 @@ * This plugin does two things: | ||
apply: 'build', | ||
// We need to run this plugin after other plugin instances, so that assertApiVersions() works also for libraries using older plugin versions | ||
enforce: 'post', | ||
@@ -47,2 +48,3 @@ configResolved() { | ||
} | ||
assertApiVersions(config, pluginConfigProvidedByLibrary.libraryName); | ||
if (!config._vitePluginServerEntry.inject) { | ||
@@ -63,3 +65,2 @@ const entries = (0, utils_1.normalizeRollupInput)(config.build.rollupOptions.input); | ||
serverIndexFilePath = config._vitePluginServerEntry.inject ? getServerIndexFilePath(config) : null; | ||
assertApiVersions(config, pluginConfigProvidedByLibrary.libraryName); | ||
clearAutoImporterFile({ status: 'RESET' }); | ||
@@ -150,5 +151,9 @@ }, | ||
apply: 'build', | ||
// We need to run this plugin before in order to make isLeaderPluginInstance() work | ||
enforce: 'pre', | ||
configResolved(configUnresolved) { | ||
// Upon the server-side build (`$ vite build --ssr`), we need to override the previous `skip` value set by the client-side build (`$ vite build`). | ||
skip = !(0, utils_1.viteIsSSR)(configUnresolved); | ||
if (skip) | ||
return; | ||
const resolved = resolveConfig(configUnresolved, pluginConfigProvidedByLibrary); | ||
@@ -155,0 +160,0 @@ config = resolved.config; |
export { assert }; | ||
export { assertUsage }; | ||
export { logLabel }; | ||
declare const logLabel: "[@brillout/vite-plugin-server-entry@0.4.1-commit-4182176]"; | ||
declare const logLabel: "[@brillout/vite-plugin-server-entry@0.4.1-commit-fa4cb7a]"; | ||
declare function assert(condition: unknown, debugInfo?: unknown): asserts condition; | ||
declare function assertUsage(condition: unknown, errorMessage: string): asserts condition; |
@@ -10,4 +10,3 @@ "use strict"; | ||
const usageErrorPrefix = `${logLabel}[Wrong Usage]`; | ||
// We set to `0` because @brillout/vite-plugin-server-entry is never used directly by the user | ||
const numberOfStackTraceLinesToRemove = 0; | ||
const numberOfStackTraceLinesToRemove = 2; | ||
function assert(condition, debugInfo) { | ||
@@ -14,0 +13,0 @@ if (condition) { |
export declare const projectInfo: { | ||
projectName: "@brillout/vite-plugin-server-entry"; | ||
npmPackageName: "@brillout/vite-plugin-server-entry"; | ||
projectVersion: "0.4.1-commit-4182176"; | ||
projectVersion: "0.4.1-commit-fa4cb7a"; | ||
githubRepository: "https://github.com/brillout/vite-plugin-server-entry"; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.projectInfo = void 0; | ||
const PROJECT_VERSION = '0.4.1-commit-4182176'; | ||
const PROJECT_VERSION = '0.4.1-commit-fa4cb7a'; | ||
exports.projectInfo = { | ||
@@ -6,0 +6,0 @@ projectName: '@brillout/vite-plugin-server-entry', |
{ | ||
"name": "@brillout/vite-plugin-server-entry", | ||
"version": "0.4.1-commit-4182176", | ||
"version": "0.4.1-commit-fa4cb7a", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@brillout/import": "^0.2.3" |
52046
1089