@rsbuild/shared
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -1,2 +0,2 @@ | ||
import { Context, SourceConfig, OutputConfig, CreateRsbuildOptions, BundlerType } from './types'; | ||
import type { Context, BundlerType, SourceConfig, OutputConfig, NormalizedConfig, CreateRsbuildOptions } from './types'; | ||
/** | ||
@@ -6,2 +6,3 @@ * Create context by config. | ||
export declare function createContextByConfig(options: Required<CreateRsbuildOptions>, bundlerType: BundlerType, sourceConfig?: SourceConfig, outputConfig?: OutputConfig): Context; | ||
export declare function updateContextByNormalizedConfig(context: Context, config: NormalizedConfig): void; | ||
export declare function createPublicContext(context: Context): Readonly<Context>; |
@@ -22,3 +22,4 @@ "use strict"; | ||
createContextByConfig: () => createContextByConfig, | ||
createPublicContext: () => createPublicContext | ||
createPublicContext: () => createPublicContext, | ||
updateContextByNormalizedConfig: () => updateContextByNormalizedConfig | ||
}); | ||
@@ -47,5 +48,3 @@ module.exports = __toCommonJS(createContext_exports); | ||
} | ||
throw new Error( | ||
"Could not find the entry file, please make sure that `src/index.(ts|js|tsx|jsx|mjs|cjs)` exists, or customize entry through the `source.entry` configuration." | ||
); | ||
return {}; | ||
} | ||
@@ -55,3 +54,2 @@ function createContextByConfig(options, bundlerType, sourceConfig = {}, outputConfig = {}) { | ||
const rootPath = cwd; | ||
const srcPath = (0, import_path.join)(rootPath, "src"); | ||
const distPath = (0, import_fs2.getAbsoluteDistPath)(cwd, outputConfig); | ||
@@ -72,3 +70,2 @@ const cachePath = (0, import_path.join)(rootPath, "node_modules", ".cache"); | ||
target, | ||
srcPath, | ||
rootPath, | ||
@@ -84,2 +81,8 @@ distPath, | ||
} | ||
function updateContextByNormalizedConfig(context, config) { | ||
context.distPath = (0, import_fs2.getAbsoluteDistPath)(context.rootPath, config.output); | ||
if (config.source.entry) { | ||
context.entry = config.source.entry; | ||
} | ||
} | ||
function createPublicContext(context) { | ||
@@ -89,3 +92,2 @@ const exposedKeys = [ | ||
"target", | ||
"srcPath", | ||
"rootPath", | ||
@@ -106,3 +108,3 @@ "distPath", | ||
}, | ||
set(target, prop) { | ||
set(_, prop) { | ||
import_logger.logger.error( | ||
@@ -118,3 +120,4 @@ `Context is readonly, you can not assign to the "context.${prop}" prop.` | ||
createContextByConfig, | ||
createPublicContext | ||
createPublicContext, | ||
updateContextByNormalizedConfig | ||
}); |
@@ -9,2 +9,3 @@ import type { DevConfig, NormalizedDevConfig } from './dev'; | ||
import type { DeepReadonly } from '../utils'; | ||
import type { RsbuildPlugin } from '..'; | ||
/** | ||
@@ -22,2 +23,3 @@ * The shared Rsbuild config. | ||
performance?: PerformanceConfig; | ||
plugins?: RsbuildPlugin[]; | ||
} | ||
@@ -32,2 +34,3 @@ export type NormalizedConfig = DeepReadonly<{ | ||
performance: NormalizedPerformanceConfig; | ||
plugins?: RsbuildPlugin[]; | ||
}>; | ||
@@ -34,0 +37,0 @@ export * from './dev'; |
@@ -11,4 +11,2 @@ import type { RsbuildEntry, RsbuildTarget } from './rsbuild'; | ||
rootPath: string; | ||
/** Absolute path of source files. */ | ||
srcPath: string; | ||
/** Absolute path of output files. */ | ||
@@ -15,0 +13,0 @@ distPath: string; |
{ | ||
"name": "@rsbuild/shared", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "The shared modules and dependencies of Rsbuild.", | ||
@@ -93,3 +93,3 @@ "homepage": "https://rsbuild.dev", | ||
"dependencies": { | ||
"@rspack/core": "0.3.12", | ||
"@rspack/core": "0.3.13", | ||
"caniuse-lite": "^1.0.30001559", | ||
@@ -103,3 +103,3 @@ "json5": "^2.2.3", | ||
"devDependencies": { | ||
"@rspack/core": "0.3.12", | ||
"@rspack/core": "0.3.13", | ||
"@types/lodash": "^4.14.200", | ||
@@ -106,0 +106,0 @@ "@types/node": "^16", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5903899
18246
+ Added@rspack/binding@0.3.13(transitive)
+ Added@rspack/binding-darwin-arm64@0.3.13(transitive)
+ Added@rspack/binding-darwin-x64@0.3.13(transitive)
+ Added@rspack/binding-linux-arm64-gnu@0.3.13(transitive)
+ Added@rspack/binding-linux-arm64-musl@0.3.13(transitive)
+ Added@rspack/binding-linux-x64-gnu@0.3.13(transitive)
+ Added@rspack/binding-linux-x64-musl@0.3.13(transitive)
+ Added@rspack/binding-win32-arm64-msvc@0.3.13(transitive)
+ Added@rspack/binding-win32-ia32-msvc@0.3.13(transitive)
+ Added@rspack/binding-win32-x64-msvc@0.3.13(transitive)
+ Added@rspack/core@0.3.13(transitive)
- Removed@rspack/binding@0.3.12(transitive)
- Removed@rspack/binding-darwin-arm64@0.3.12(transitive)
- Removed@rspack/binding-darwin-x64@0.3.12(transitive)
- Removed@rspack/binding-linux-arm64-gnu@0.3.12(transitive)
- Removed@rspack/binding-linux-arm64-musl@0.3.12(transitive)
- Removed@rspack/binding-linux-x64-gnu@0.3.12(transitive)
- Removed@rspack/binding-linux-x64-musl@0.3.12(transitive)
- Removed@rspack/binding-win32-arm64-msvc@0.3.12(transitive)
- Removed@rspack/binding-win32-ia32-msvc@0.3.12(transitive)
- Removed@rspack/binding-win32-x64-msvc@0.3.12(transitive)
- Removed@rspack/core@0.3.12(transitive)
Updated@rspack/core@0.3.13