@rspack/core
Advanced tools
Comparing version 0.0.0-20221125103438 to 0.0.0-20221129130808
@@ -328,7 +328,3 @@ "use strict"; | ||
_Compiler__instance = new WeakMap(), _Compiler_instances = new WeakSet(), _Compiler_instance_get = function _Compiler_instance_get() { | ||
const options = { | ||
...this.options, | ||
// @ts-ignore: TODO: fix this | ||
entry: this.options.entry | ||
}; | ||
const options = this.options; | ||
__classPrivateFieldSet(this, _Compiler__instance, __classPrivateFieldGet(this, _Compiler__instance, "f") || | ||
@@ -335,0 +331,0 @@ new binding.Rspack(options, { |
@@ -1,3 +0,18 @@ | ||
export declare type Entry = string | string[] | Record<string, string | string[]>; | ||
export declare type ResolvedEntry = Record<string, string[]>; | ||
export declare type EntryRuntime = false | string; | ||
export interface EntryDescription { | ||
import: EntryItem; | ||
runtime?: EntryRuntime; | ||
} | ||
export interface ResolvedEntryItem { | ||
import: string[]; | ||
runtime?: string; | ||
} | ||
export declare type EntryItem = string[] | string; | ||
export declare type EntryUnnamed = EntryItem; | ||
export declare type Entry = EntryStatic; | ||
export interface EntryObject { | ||
[k: string]: EntryItem | EntryDescription; | ||
} | ||
export declare type EntryStatic = EntryObject | EntryUnnamed; | ||
export declare type ResolvedEntry = Record<string, ResolvedEntryItem>; | ||
interface ResolveEntryContext { | ||
@@ -4,0 +19,0 @@ context: string; |
@@ -11,3 +11,5 @@ "use strict"; | ||
return { | ||
main: [path_1.default.resolve(context.context, "src", "index.js")] | ||
main: normalizeEntryItem("main", { | ||
import: [path_1.default.resolve(context.context, "src", "index.js")] | ||
}) | ||
}; | ||
@@ -17,3 +19,5 @@ } | ||
return { | ||
main: [options] | ||
main: normalizeEntryItem("main", { | ||
import: [options] | ||
}) | ||
}; | ||
@@ -23,3 +27,5 @@ } | ||
return { | ||
main: [...options] | ||
main: normalizeEntryItem("main", { | ||
import: [...options] | ||
}) | ||
}; | ||
@@ -30,6 +36,19 @@ } | ||
if (Array.isArray(value)) { | ||
return [key, [...value]]; | ||
return [ | ||
key, | ||
normalizeEntryItem(key, { | ||
import: [...value] | ||
}) | ||
]; | ||
} | ||
else if (typeof value === "object") { | ||
return [key, normalizeEntryItem(key, value)]; | ||
} | ||
else { | ||
return [key, [value]]; | ||
return [ | ||
key, | ||
normalizeEntryItem(key, { | ||
import: [value] | ||
}) | ||
]; | ||
} | ||
@@ -43,2 +62,10 @@ })); | ||
exports.resolveEntryOptions = resolveEntryOptions; | ||
function normalizeEntryItem(entryName, entryItem) { | ||
return { | ||
import: Array.isArray(entryItem.import) | ||
? entryItem.import | ||
: [entryItem.import], | ||
runtime: entryItem.runtime === false ? undefined : entryItem.runtime | ||
}; | ||
} | ||
//# sourceMappingURL=entry.js.map |
@@ -99,3 +99,3 @@ "use strict"; | ||
result = use.loader.apply(loaderContext, [ | ||
use.loader.raw ? content : content.toString("utf-8"), | ||
use.loader.raw ? Buffer.from(content) : content.toString("utf-8"), | ||
sourceMap, | ||
@@ -161,3 +161,7 @@ additionalData | ||
content: [...toBuffer(content)], | ||
// TODO: Support `SourceMap` | ||
sourceMap: [ | ||
...toBuffer(typeof sourceMap === "string" | ||
? sourceMap | ||
: JSON.stringify(sourceMap || {})) | ||
], | ||
// TODO: Use `None` for the rust side | ||
@@ -164,0 +168,0 @@ additionalData: [...toBuffer(JSON.stringify(additionalData || {}))] |
@@ -9,2 +9,4 @@ export interface Output { | ||
hashFunction?: string; | ||
cssFilename?: string; | ||
cssChunkFilename?: string; | ||
} | ||
@@ -22,4 +24,6 @@ export interface ResolvedOutput { | ||
hashSalt?: string; | ||
cssFilename?: string; | ||
cssChunkFilename?: string; | ||
} | ||
export declare function resolveOutputOptions(output?: Output): ResolvedOutput; | ||
//# sourceMappingURL=output.d.ts.map |
@@ -20,3 +20,3 @@ import type { ResolvedTarget } from "./target"; | ||
alias: Record<string, string>; | ||
tsConfigPath: string; | ||
tsConfigPath: string | undefined; | ||
}; | ||
@@ -23,0 +23,0 @@ interface ResolveContext { |
@@ -5,3 +5,3 @@ "use strict"; | ||
function resolveResolveOptions(resolve = {}, { target }) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
const preferRelative = (_a = resolve.preferRelative) !== null && _a !== void 0 ? _a : false; | ||
@@ -25,3 +25,3 @@ const extensions = (_b = resolve.extensions) !== null && _b !== void 0 ? _b : [ | ||
const conditionNames = (_g = resolve.conditionNames) !== null && _g !== void 0 ? _g : ["module", "import"]; | ||
const tsConfigPath = (_h = resolve.tsConfigPath) !== null && _h !== void 0 ? _h : ""; | ||
const tsConfigPath = resolve.tsConfigPath; | ||
return { | ||
@@ -28,0 +28,0 @@ preferRelative, |
{ | ||
"name": "@rspack/core", | ||
"version": "0.0.0-20221125103438", | ||
"version": "0.0.0-20221129130808", | ||
"main": "./dist/index.js", | ||
@@ -10,3 +10,2 @@ "types": "./dist/index.d.ts", | ||
"devDependencies": { | ||
"@rspack/core": "0.0.0-20221125103438", | ||
"@swc/helpers": "^0.4.12", | ||
@@ -26,11 +25,10 @@ "@types/jest": "29.0.2", | ||
"util": "0.12.5", | ||
"@rspack/plugin-less": "^0.0.0-20221125103438", | ||
"@rspack/plugin-postcss": "^0.0.0-20221125103438", | ||
"@rspack/plugin-node-polyfill": "^0.0.0-20221125103438", | ||
"rimraf": "3.0.2", | ||
"@types/rimraf": "3.0.2" | ||
"@types/rimraf": "3.0.2", | ||
"@rspack/plugin-node-polyfill": "^0.0.0-20221129130808", | ||
"@rspack/less-loader": "^0.0.0-20221129130808", | ||
"@rspack/postcss-loader": "^0.0.0-20221129130808", | ||
"@rspack/core": "0.0.0-20221129130808" | ||
}, | ||
"dependencies": { | ||
"@rspack/binding": "0.0.0-20221125103438", | ||
"@rspack/dev-client": "0.0.0-20221125103438", | ||
"browserslist": "^4.21.3", | ||
@@ -43,3 +41,5 @@ "chokidar": "3.5.3", | ||
"react-refresh": "0.14.0", | ||
"@swc/helpers": "0.4.13" | ||
"@swc/helpers": "0.4.13", | ||
"@rspack/binding": "0.0.0-20221129130808", | ||
"@rspack/dev-client": "0.0.0-20221129130808" | ||
}, | ||
@@ -60,4 +60,3 @@ "optionalDependencies": { | ||
"test": "jest --verbose" | ||
}, | ||
"readme": "# rspack\n" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
301475
4371
166
+ Added@rspack/binding@0.0.0-20221129130808(transitive)
+ Added@rspack/dev-client@0.0.0-20221129130808(transitive)
- Removed@rspack/binding@0.0.0-20221125103438(transitive)
- Removed@rspack/dev-client@0.0.0-20221125103438(transitive)