# file-loader 从入口到输出调用栈

  • node_modules/webpack-cli/bin/cli.js compiler.run((err, stats)) 【353】

  • node_modules/webpack/lib/Compiler.js run(callback) {} 【247】

  • node_modules/webpack/lib/Compiler.js this.compile(onCompiled); 【321 】

  • node_modules/webpack/lib/Compiler.js compile(callback) {} - 【660】

    • node_modules/webpack/lib/Compiler.js const params = this.newCompilationParams(); 【661】

      • node_modules/webpack/lib/Compiler.js this.createNormalModuleFactory()【 653】

        • node_modules/webpack/lib/Compiler.js new NormalModuleFactory() 【636】

          • node_modules/webpack/lib/NormalModuleFactory.js this.hooks.afterResolve.callAsync(data, (err, result) => {}) 【138】

          • node_modules/webpack/lib/NormalModuleFactory.js createdModule = new NormalModule(result);【 150 】

          • node_modules/webpack/lib/NormalModuleFactory.js return callback(null, createdModule);【 155】

            • node_modules/webpack/lib/Compilation.js this.buildModule(module, false, null, null, err => {}) 【1111 】

            • node_modules/webpack/lib/Compilation.js module.build() 【739 】

            • node_modules/webpack/lib/NormalModule.js build(options, compilation, resolver, fs, callback) {} 【438 】

            • node_modules/webpack/lib/NormalModule.js return this.doBuild() 【457 】

            • node_modules/webpack/lib/NormalModule.js doBuild(options, compilation, resolver, fs, callback) 【294 】

            • node_modules/webpack/lib/NormalModule.js runLoaders()【306】

              • node_modules/loader-runner/lib/LoaderRunner.js return fn.apply(context, args); 【119】

                • file-loader/dist/index.js function loader(content) {} 【21】
                • file-loader/dist/index.js this.emitFile(outputPath, content, null, assetInfo); 【79】
                  • node_modules/webpack/lib/NormalModule.js emitFile: (name, content, sourceMap, assetInfo) => {} 【215】
      • node_modules/webpack/lib/Compiler.js return callback(null, compilation); 【 681 】

        • node_modules/webpack/lib/Compiler.js const onCompiled = (err, compilation) => {} 【 264】

          • node_modules/webpack/lib/Compiler.js this.emitAssets(compilation, err => {})【278】

          • node_modules/webpack/lib/Compiler.js emitAssets(compilation, callback) {}【353】

          • node_modules/webpack/lib/Compiler.js this.outputFileSystem.mkdirp(outputPath, emitFiles);【494】

          • node_modules/webpack/lib/Compiler.js writeOut();【476/473】

          • node_modules/webpack/lib/Compiler.js js this.outputFileSystem.writeFile(targetPath, content, err => { if (err) return callback(err); this.hooks.assetEmitted.callAsync(file, content, callback);});【462】

          • node_modules/webpack/lib/Compiler.js this.hooks.assetEmitted.callAsync(file, content, callback);【464】