摘要:從出來(lái)接著我們看大法,打印一下感覺(jué)之前所以的對(duì)象都放在了一個(gè)合集里,給人而全的感覺(jué)里面主要含有一個(gè)對(duì)象,,輸出的,等給每次打包一個(gè)值,代表唯一性天啊
從compilation出來(lái)
接著我們看
const stats = new Stats(compilation);Stats.js
log大法,打印一下 stats
let Stats = { compilation:{ _pluginCompat: SyncBailHook { _args: [Array], taps: [Array], interceptors: [], call: [Function: lazyCompileHook], promise: [Function: lazyCompileHook], callAsync: [Function: lazyCompileHook], _x: undefined }, hooks: { buildModule: [SyncHook], rebuildModule: [SyncHook], failedModule: [SyncHook], succeedModule: [SyncHook], addEntry: [SyncHook], failedEntry: [SyncHook], succeedEntry: [SyncHook], dependencyReference: [SyncWaterfallHook], finishModules: [SyncHook], finishRebuildingModule: [SyncHook], unseal: [SyncHook], seal: [SyncHook], beforeChunks: [SyncHook], afterChunks: [SyncHook], optimizeDependenciesBasic: [SyncBailHook], optimizeDependencies: [SyncBailHook], optimizeDependenciesAdvanced: [SyncBailHook], afterOptimizeDependencies: [SyncHook], optimize: [SyncHook], optimizeModulesBasic: [SyncBailHook], optimizeModules: [SyncBailHook], optimizeModulesAdvanced: [SyncBailHook], afterOptimizeModules: [SyncHook], optimizeChunksBasic: [SyncBailHook], optimizeChunks: [SyncBailHook], optimizeChunksAdvanced: [SyncBailHook], afterOptimizeChunks: [SyncHook], optimizeTree: [AsyncSeriesHook], afterOptimizeTree: [SyncHook], optimizeChunkModulesBasic: [SyncBailHook], optimizeChunkModules: [SyncBailHook], optimizeChunkModulesAdvanced: [SyncBailHook], afterOptimizeChunkModules: [SyncHook], shouldRecord: [SyncBailHook], reviveModules: [SyncHook], optimizeModuleOrder: [SyncHook], advancedOptimizeModuleOrder: [SyncHook], beforeModuleIds: [SyncHook], moduleIds: [SyncHook], optimizeModuleIds: [SyncHook], afterOptimizeModuleIds: [SyncHook], reviveChunks: [SyncHook], optimizeChunkOrder: [SyncHook], beforeChunkIds: [SyncHook], optimizeChunkIds: [SyncHook], afterOptimizeChunkIds: [SyncHook], recordModules: [SyncHook], recordChunks: [SyncHook], beforeHash: [SyncHook], contentHash: [SyncHook], afterHash: [SyncHook], recordHash: [SyncHook], record: [SyncHook], beforeModuleAssets: [SyncHook], shouldGenerateChunkAssets: [SyncBailHook], beforeChunkAssets: [SyncHook], additionalChunkAssets: [SyncHook], additionalAssets: [AsyncSeriesHook], optimizeChunkAssets: [AsyncSeriesHook], afterOptimizeChunkAssets: [SyncHook], optimizeAssets: [AsyncSeriesHook], afterOptimizeAssets: [SyncHook], needAdditionalSeal: [SyncBailHook], afterSeal: [AsyncSeriesHook], chunkHash: [SyncHook], moduleAsset: [SyncHook], chunkAsset: [SyncHook], assetPath: [SyncWaterfallHook], needAdditionalPass: [SyncBailHook], childCompiler: [SyncHook], normalModuleLoader: [SyncHook], optimizeExtractedChunksBasic: [SyncBailHook], optimizeExtractedChunks: [SyncBailHook], optimizeExtractedChunksAdvanced: [SyncBailHook], afterOptimizeExtractedChunks: [SyncHook] }, name: undefined, compiler: { _pluginCompat: [SyncBailHook], hooks: [Object], name: undefined, parentCompilation: undefined, outputPath: "/Users/orion/Desktop/react-beauty-highcharts/dist", outputFileSystem: [NodeOutputFileSystem], inputFileSystem: [CachedInputFileSystem], recordsInputPath: undefined, recordsOutputPath: undefined, records: [Object], removedFiles: Set {}, fileTimestamps: Map {}, contextTimestamps: Map {}, resolverFactory: [ResolverFactory], resolvers: [Object], options: [Object], context: "/Users/orion/Desktop/react-beauty-highcharts", requestShortener: [RequestShortener], running: true, watchMode: false, watchFileSystem: [NodeWatchFileSystem], dependencies: undefined, _lastCompilationFileDependencies: [SortableSet], _lastCompilationContextDependencies: [SortableSet] }, resolverFactory: ResolverFactory { _pluginCompat: [SyncBailHook], hooks: [Object], cache1: [WeakMap], cache2: [Map] }, inputFileSystem: CachedInputFileSystem { fileSystem: NodeJsInputFileSystem {}, _statStorage: [Storage], _readdirStorage: [Storage], _readFileStorage: [Storage], _readJsonStorage: [Storage], _readlinkStorage: [Storage], _stat: [Function: bound bound ], _statSync: [Function: bound bound ], _readdir: [Function: bound readdir], _readdirSync: [Function: bound readdirSync], _readFile: [Function: bound bound readFile], _readFileSync: [Function: bound bound readFileSync], _readJson: [Function], _readJsonSync: [Function], _readlink: [Function: bound bound readlink], _readlinkSync: [Function: bound bound readlinkSync] }, requestShortener: RequestShortener { currentDirectoryRegExp: /(^|!)/Users/orion/Desktop/react-beauty-highcharts/g, parentDirectoryRegExp: /(^|!)/Users/orion/Desktop/g, buildinsAsModule: true, buildinsRegExp: /(^|!)/Users/orion/Desktop/react-beauty-highcharts/node_modules/webpack/g, cache: [Map] }, options: { entry: "./src/index.js", output: [Object], module: [Object], devServer: [Object], externals: [Array], mode: "development", plugins: [Array], devtool: "eval-cheap-module-source-map", context: "/Users/orion/Desktop/react-beauty-highcharts", cache: true, target: "web", node: [Object], performance: false, optimization: [Object], resolve: [Object], resolveLoader: [Object] }, outputOptions: { filename: "index.js", path: "/Users/orion/Desktop/react-beauty-highcharts/dist", libraryTarget: "commonjs2", pathinfo: true, chunkFilename: "[id].index.js", webassemblyModuleFilename: "[modulehash].module.wasm", library: "", hotUpdateFunction: "webpackHotUpdate", jsonpFunction: "webpackJsonp", chunkCallbackName: "webpackChunk", globalObject: "window", devtoolNamespace: "", sourceMapFilename: "[file].map[query]", hotUpdateChunkFilename: "[id].[hash].hot-update.js", hotUpdateMainFilename: "[hash].hot-update.json", crossOriginLoading: false, jsonpScriptType: false, chunkLoadTimeout: 120000, hashFunction: "md4", hashDigest: "hex", hashDigestLength: 20, devtoolLineToLine: false, strictModuleExceptionHandling: false }, bail: undefined, profile: undefined, performance: false, mainTemplate: { _pluginCompat: [SyncBailHook], outputOptions: [Object], hooks: [Object], requireFn: "__webpack_require__" }, chunkTemplate: { _pluginCompat: [SyncBailHook], outputOptions: [Object], hooks: [Object] }, hotUpdateChunkTemplate:{ _pluginCompat: [SyncBailHook], outputOptions: [Object], hooks: [Object] }, runtimeTemplate:{ outputOptions: [Object], requestShortener: [RequestShortener] }, moduleTemplates: { javascript: [ModuleTemplate], webassembly: [ModuleTemplate] }, semaphore:{ available: 100, waiters: [], _continue: [Function: bound _continue] }, entries: [ [NormalModule] ], _preparedEntrypoints: [ [Object] ], entrypoints: Map { "main" => [Entrypoint] }, chunks: [ [Chunk] ], chunkGroups: [ [Entrypoint] ], namedChunkGroups: Map { "main" => [Entrypoint] }, namedChunks: Map { "main" => [Chunk] }, modules: [ [NormalModule] ], _modules:{ "/Users/orion/Desktop/react-beauty-highcharts/node_modules/babel-loader/lib/index.js!/Users/orion/Desktop/react-beauty-highcharts/src/index.js" => [NormalModule] }, cache: { "m/Users/orion/Desktop/react-beauty-highcharts/node_modules/babel-loader/lib/index.js!/Users/orion/Desktop/react-beauty-highcharts/src/index.js": [NormalModule], chunkmain: [Object] }, records: { modules: [Object], chunks: [Object] }, additionalChunkAssets: [], assets: { "index.js": [CachedSource] }, errors: [], warnings: [], children: [], dependencyFactories:{ [Function] => NullFactory {}, [Function: WebAssemblyImportDependency] => [NormalModuleFactory], [Function: WebAssemblyExportImportedDependency] => [NormalModuleFactory], [Function: SingleEntryDependency] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => NullFactory {}, [Function] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => NullFactory {}, [Function] => NullFactory {}, [Function] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => [ContextModuleFactory], [Function] => NullFactory {}, [Function] => NullFactory {}, [Function] => NullFactory {}, [Function] => [NormalModuleFactory], [Function] => [ContextModuleFactory], [Function] => [NormalModuleFactory], [Function] => [ContextModuleFactory], [Function] => NullFactory {}, [Function] => NullFactory {}, [Function: LoaderDependency] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => NullFactory {}, [Function] => [ContextModuleFactory], [Function: ContextElementDependency] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => [NormalModuleFactory], [Function] => [ContextModuleFactory] }, dependencyTemplates:{ "hash" => "", [Function] => ConstDependencyTemplate {}, [Function] => HarmonyExportDependencyTemplate {}, [Function] => HarmonyInitDependencyTemplate {}, [Function] => HarmonyImportSideEffectDependencyTemplate {}, [Function] => HarmonyImportSpecifierDependencyTemplate {}, [Function] => HarmonyExportDependencyTemplate {}, [Function] => HarmonyExportDependencyTemplate {}, [Function] => HarmonyExportSpecifierDependencyTemplate {}, [Function] => HarmonyExportImportedSpecifierDependencyTemplate {}, [Function] => HarmonyAcceptDependencyTemplate {}, [Function] => HarmonyAcceptImportDependencyTemplate {}, [Function] => AMDRequireDependencyTemplate {}, [Function] => ModuleDependencyTemplateAsRequireId {}, [Function] => AMDRequireArrayDependencyTemplate {}, [Function] => ContextDependencyTemplateAsRequireCall {}, [Function] => AMDDefineDependencyTemplate {}, [Function] => UnsupportedDependencyTemplate {}, [Function] => LocalModuleDependencyTemplate {}, [Function] => ModuleDependencyTemplateAsId {}, [Function] => ContextDependencyTemplateAsRequireCall {}, [Function] => ModuleDependencyTemplateAsId {}, [Function] => ContextDependencyTemplateAsId {}, [Function] => RequireResolveHeaderDependencyTemplate {}, [Function] => RequireHeaderDependencyTemplate {}, [Function] => RequireIncludeDependencyTemplate {}, [Function] => NullDependencyTemplate {}, [Function] => RequireEnsureDependencyTemplate {}, [Function] => ModuleDependencyTemplateAsRequireId {}, [Function] => ImportDependencyTemplate {}, [Function] => ImportEagerDependencyTemplate {}, [Function] => ImportDependencyTemplate {}, [Function] => ContextDependencyTemplateAsRequireCall {} }, childrenCounters: {}, usedChunkIds: null, usedModuleIds: null, fileTimestamps: Map {}, contextTimestamps: Map {}, compilationDependencies: Set {}, _buildingModules: Map {}, _rebuildingModules: Map {}, fullHash: "41d7d3a4c3eeb4a7fe6a4dcb5b927f6b", hash: "41d7d3a4c3eeb4a7fe6a", fileDependencies: { "/Users/orion/Desktop/react-beauty-highcharts/.babelrc", "/Users/orion/Desktop/react-beauty-highcharts/src/index.js", _sortFn: undefined, _lastActiveSortFn: undefined, _cache: undefined, _cacheOrderIndependent: undefined }, contextDependencies: { _sortFn: undefined, _lastActiveSortFn: null, _cache: undefined, _cacheOrderIndependent: undefined }, missingDependencies:{ _sortFn: undefined, _lastActiveSortFn: null, _cache: undefined, _cacheOrderIndependent: undefined } }, hash: "41d7d3a4c3eeb4a7fe6a", startTime: undefined, endTime: undefined }
感覺(jué)之前所以的對(duì)象都放在了一個(gè)合集里,給人而全的感覺(jué)
里面主要含有一個(gè)對(duì)象
inputFileSyste,options,輸出的outputOptions,dependencyFactories等
給每次打包一個(gè)hash值,代表唯一性
天啊
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/101226.html
摘要:打開是個(gè)構(gòu)造函數(shù),定義了一些靜態(tài)屬性和方法我們先看在插件下地址上面寫的解釋就跟沒(méi)寫一樣在文件下我們看到輸出的一些對(duì)象方法每一個(gè)對(duì)應(yīng)一個(gè)模塊而在下引入的下面,我們先研究引入的對(duì)象的英文單詞解釋,除了最常用的點(diǎn)擊手勢(shì)之外,還有一個(gè)意思是水龍頭進(jìn) 打開compile class Compiler extends Tapable { constructor(context) { ...
摘要:編寫良好的模塊提供了可靠的抽象和封裝邊界,構(gòu)成了一致的設(shè)計(jì)和明確的目的。塊此特定術(shù)語(yǔ)在內(nèi)部用于管理捆綁過(guò)程。捆綁包由塊組成,其中有幾種類型例如入口和子。總結(jié)一個(gè)塊是進(jìn)程中的一組模塊,一個(gè)是一個(gè)發(fā)出的塊或一組塊。 我們先看一下 compilation是什么?是一個(gè)很大的對(duì)象打印key值 [ _pluginCompat, hooks, name, compiler, res...
為什么讀webpack源碼 因?yàn)榍岸丝蚣茈x不開webpack,天天都在用的東西啊,怎能不研究 讀源碼能學(xué)到很多做項(xiàng)目看書學(xué)不到的東西,比如說(shuō)架構(gòu),構(gòu)造函數(shù),es6很邊緣的用法,甚至給函數(shù)命名也會(huì)潛移默化的影響等 想寫源碼,不看源碼怎么行,雖然現(xiàn)在還不知道寫什么,就算不寫什么,看看別人寫的總可以吧 知道世界的廣闊,那么多插件,那么多軟件開發(fā)師,他們?cè)谧鍪裁矗瑯邮菍慾s的,怎么他們能這么偉大 好奇...
摘要:我們打開根據(jù)上次所返回的這個(gè)因?yàn)橛辛松洗蔚幕A(chǔ),比較容易讀了大體邏輯是這樣的先定義一個(gè)空對(duì)象同上次的一個(gè)邏輯,還是一個(gè)目前的方式只有一個(gè)滿足如果滿足的會(huì)執(zhí)行一系列函數(shù)這個(gè)函數(shù)直接結(jié)果是的影響是打比如如果滿足的話當(dāng)你的時(shí)候就會(huì)在頁(yè)面上出 我們打開bin/cli.js根據(jù)上次所返回的Options processOptions(options)這個(gè)因?yàn)橛辛松洗蔚幕A(chǔ),比較容易讀了,大體邏輯...
摘要:接下來(lái)我看看一下函數(shù)我們先按照分支走為讀取是里的對(duì)象,饒了這大的一個(gè)圈子,那么接下來(lái)一起來(lái)看一看對(duì)你的輸入配置做了怎么樣的處理吧 打開webpeck-cli下的convert-argv.js文件 // 定義options為空數(shù)組 const options = []; // webpack -d 檢查 -d指令 if (argv.d) { //... } ...
閱讀 2521·2023-04-26 02:57
閱讀 1403·2023-04-25 21:40
閱讀 2155·2021-11-24 09:39
閱讀 3557·2021-08-30 09:49
閱讀 760·2019-08-30 15:54
閱讀 1166·2019-08-30 15:52
閱讀 2068·2019-08-30 15:44
閱讀 1274·2019-08-28 18:27