* Builds the module using the provided compilation context. * @param {WebpackOptions} options webpack options * @param {Compilation} compilation the compilation * @param {ResolverWithOptions} resolver the resolver * @param {InputFileSystem} fs the file system * @param {BuildCallback} callb
(options, compilation, resolver, fs, callback)
| 1767 | * @returns {void} |
| 1768 | */ |
| 1769 | build(options, compilation, resolver, fs, callback) { |
| 1770 | this._forceBuild = false; |
| 1771 | this._source = null; |
| 1772 | if (this._sourceSizes !== undefined) this._sourceSizes.clear(); |
| 1773 | this._sourceTypes = undefined; |
| 1774 | this._ast = null; |
| 1775 | this.error = null; |
| 1776 | this.clearWarningsAndErrors(); |
| 1777 | this.clearDependenciesAndBlocks(); |
| 1778 | this.buildMeta = { |
| 1779 | exportsType: undefined, |
| 1780 | defaultObject: undefined, |
| 1781 | strictHarmonyModule: undefined, |
| 1782 | async: undefined |
| 1783 | }; |
| 1784 | this.buildInfo = { |
| 1785 | cacheable: false, |
| 1786 | parsed: true, |
| 1787 | fileDependencies: undefined, |
| 1788 | contextDependencies: undefined, |
| 1789 | missingDependencies: undefined, |
| 1790 | buildDependencies: undefined, |
| 1791 | valueDependencies: undefined, |
| 1792 | hash: undefined, |
| 1793 | assets: undefined, |
| 1794 | assetsInfo: undefined, |
| 1795 | snapshot: undefined, |
| 1796 | strict: undefined, |
| 1797 | exportsArgument: undefined, |
| 1798 | moduleArgument: undefined, |
| 1799 | topLevelDeclarations: undefined, |
| 1800 | pureFunctions: undefined, |
| 1801 | inlineExports: undefined, |
| 1802 | moduleConcatenationBailout: undefined, |
| 1803 | needCreateRequire: undefined |
| 1804 | }; |
| 1805 | |
| 1806 | const startTime = compilation.compiler.fsStartTime || Date.now(); |
| 1807 | |
| 1808 | const hooks = NormalModule.getCompilationHooks(compilation); |
| 1809 | |
| 1810 | return this._doBuild(options, compilation, resolver, fs, hooks, (err) => { |
| 1811 | class="cm">// if we have an error mark module as failed and exit |
| 1812 | if (err) { |
| 1813 | this.markModuleAsErrored(err); |
| 1814 | this._initBuildHash(compilation); |
| 1815 | return callback(); |
| 1816 | } |
| 1817 | |
| 1818 | /** |
| 1819 | * @param {Error} e error |
| 1820 | * @returns {void} |
| 1821 | */ |
| 1822 | const handleParseError = (e) => { |
| 1823 | const source = /** @type {Source} */ (this._source).source(); |
| 1824 | const loaders = this.loaders.map((item) => |
| 1825 | contextify(options.context, item.loader, compilation.compiler.root) |
| 1826 | ); |
nothing calls this directly
no test coverage detected