Socket
Socket
Sign inDemoInstall

@types/webpack

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/webpack - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

344

webpack/index.d.ts
// Type definitions for webpack 2.2
// Project: https://github.com/webpack/webpack
// Definitions by: Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>
// Definitions by: Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as UglifyJS from 'uglify-js';

@@ -13,4 +15,4 @@ import * as tapable from 'tapable';

entry?: string | string[] | Entry;
/** Choose a developer tool to enhance debugging. */
devtool?: string;
/** Choose a style of source mapping to enhance the debugging process. These values can affect build and rebuild speed dramatically. */
devtool?: 'eval' | 'inline-source-map' | 'cheap-eval-source-map' | 'cheap-source-map' | 'cheap-module-eval-source-map' | 'cheap-module-source-map' | 'eval-source-map' | 'source-map' | 'nosources-source-map' | 'hidden-source-map' | 'nosources-source-map' | '@eval' | '@inline-source-map' | '@cheap-eval-source-map' | '@cheap-source-map' | '@cheap-module-eval-source-map' | '@cheap-module-source-map' | '@eval-source-map' | '@source-map' | '@nosources-source-map' | '@hidden-source-map' | '@nosources-source-map' | '#eval' | '#inline-source-map' | '#cheap-eval-source-map' | '#cheap-source-map' | '#cheap-module-eval-source-map' | '#cheap-module-source-map' | '#eval-source-map' | '#source-map' | '#nosources-source-map' | '#hidden-source-map' | '#nosources-source-map' | '#@eval' | '#@inline-source-map' | '#@cheap-eval-source-map' | '#@cheap-source-map' | '#@cheap-module-eval-source-map' | '#@cheap-module-source-map' | '#@eval-source-map' | '#@source-map' | '#@nosources-source-map' | '#@hidden-source-map' | '#@nosources-source-map' | boolean;
/** Options affecting the output. */

@@ -329,2 +331,4 @@ output?: Output;

aggregateTimeout?: number;
/** For some systems, watching many file systems can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like node_modules. It is also possible to use anymatch patterns. */
ignored?: RegExp | string;
/** true: use polling, number: use polling with specified interval */

@@ -737,2 +741,272 @@ poll?: boolean | number;

namespace loader {
interface Loader extends Function {
(this: LoaderContext, source: string | Buffer, sourceMap: string | Buffer): string | Buffer | void | undefined;
/**
* The order of chained loaders are always called from right to left.
* But, in some cases, loaders do not care about the results of the previous loader or the resource.
* They only care for metadata. The pitch method on the loaders is called from left to right before the loaders are called (from right to left).
* If a loader delivers a result in the pitch method the process turns around and skips the remaining loaders,
* continuing with the calls to the more left loaders. data can be passed between pitch and normal call.
* @param remainingRequest
* @param precedingRequest
* @param data
*/
pitch?(remainingRequest: string, precedingRequest: string, data: any): any | undefined;
/**
* By default, the resource file is treated as utf-8 string and passed as String to the loader.
* By setting raw to true the loader is passed the raw Buffer.
* Every loader is allowed to deliver its result as String or as Buffer.
* The compiler converts them between loaders.
*/
raw?: boolean;
}
type loaderCallback = (err: Error | undefined | null, content?: string | Buffer, sourceMap?: string | Buffer) => void;
interface LoaderContext {
/**
* Loader API version. Currently 2.
* This is useful for providing backwards compatibility.
* Using the version you can specify custom logic or fallbacks for breaking changes.
*/
version: string;
/**
* The directory of the module. Can be used as context for resolving other stuff.
* In the example: /abc because resource.js is in this directory
*/
context: string;
/**
* The resolved request string.
* In the example: "/abc/loader1.js?xyz!/abc/node_modules/loader2/index.js!/abc/resource.js?rrr"
*/
request: string;
/**
* A string or any object. The query of the request for the current loader.
*/
query: any;
/**
* A data object shared between the pitch and the normal phase.
*/
data?: any;
callback: loaderCallback | void;
/**
* Make this loader async.
*/
async(): loaderCallback | undefined;
/**
* Make this loader result cacheable. By default it's not cacheable.
* A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
* This means the loader shouldn't have other dependencies than specified with this.addDependency.
* Most loaders are deterministic and cacheable.
*/
cacheable(flag?: boolean): void;
/**
* loaders = [{request: string, path: string, query: string, module: function}]
* An array of all the loaders. It is writeable in the pitch phase.
* In the example:
* [
* { request: "/abc/loader1.js?xyz",
* path: "/abc/loader1.js",
* query: "?xyz",
* module: [Function]
* },
* { request: "/abc/node_modules/loader2/index.js",
* path: "/abc/node_modules/loader2/index.js",
* query: "",
* module: [Function]
* }
*]
*/
loaders: any[];
/**
* The index in the loaders array of the current loader.
* In the example: in loader1: 0, in loader2: 1
*/
loaderIndex: number;
/**
* The resource part of the request, including query.
* In the example: "/abc/resource.js?rrr"
*/
resource: string;
/**
* The resource file.
* In the example: "/abc/resource.js"
*/
resourcePath: string
/**
* The query of the resource.
* In the example: "?rrr"
*/
resourceQuery: string;
/**
* Emit a warning.
* @param message
*/
emitWarning(message: string): void;
/**
* Emit a error.
* @param message
*/
emitError(message: string): void;
/**
* Execute some code fragment like a module.
*
* Don't use require(this.resourcePath), use this function to make loaders chainable!
*
* @param code
* @param filename
*/
exec(code: string, filename: string): any;
/**
* Resolve a request like a require expression.
* @param context
* @param request
* @param callback
*/
resolve(context: string, request: string, callback: (err: Error, result: string) => void): any
/**
* Resolve a request like a require expression.
* @param context
* @param request
*/
resolveSync(context: string, request: string): string
/**
* Adds a file as dependency of the loader result in order to make them watchable.
* For example, html-loader uses this technique as it finds src and src-set attributes.
* Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
* @param file
*/
addDependency(file: string): void;
/**
* Adds a file as dependency of the loader result in order to make them watchable.
* For example, html-loader uses this technique as it finds src and src-set attributes.
* Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
* @param file
*/
dependency(file: string): void;
/**
* Add a directory as dependency of the loader result.
* @param directory
*/
addContextDependency(directory: string): void
/**
* Remove all dependencies of the loader result. Even initial dependencies and these of other loaders. Consider using pitch.
*/
clearDependencies(): void;
/**
* Pass values to the next loader.
* If you know what your result exports if executed as module, set this value here (as a only element array).
*/
value: any;
/**
* Passed from the last loader.
* If you would execute the input argument as module, consider reading this variable for a shortcut (for performance).
*/
inputValue: any;
/**
* The options passed to the Compiler.
*/
options: any;
/**
* A boolean flag. It is set when in debug mode.
*/
debug: boolean;
/**
* Should the result be minimized.
*/
minimize: boolean;
/**
* Should a SourceMap be generated.
*/
sourceMap: boolean;
/**
* Target of compilation. Passed from configuration options.
* Example values: "web", "node"
*/
target: 'web' | 'node' | string;
/**
* This boolean is set to true when this is compiled by webpack.
*
* Loaders were originally designed to also work as Babel transforms.
* Therefore if you write a loader that works for both, you can use this property to know if
* there is access to additional loaderContext and webpack features.
*/
webpack: boolean;
/**
* Emit a file. This is webpack-specific.
* @param name
* @param content
* @param sourceMap
*/
emitFile(name: string, content: Buffer|String, sourceMap: any): void
/**
* Access to the compilation's inputFileSystem property.
*/
fs: any;
/**
* Hacky access to the Compilation object of webpack.
*/
_compilation: any;
/**
* Hacky access to the Compiler object of webpack.
*/
_compiler: compiler.Compiler;
/**
* Hacky access to the Module object being loaded.
*/
_module: any;
}
}
namespace optimize {

@@ -791,2 +1065,4 @@ interface DedupePluginStatic {

aggregateTimeout?: number;
/** For some systems, watching many file systems can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like node_modules. It is also possible to use anymatch patterns. */
ignored?: RegExp | string;
/** The watcher uses polling instead of native watchers. true uses the default interval, a number specifies a interval in milliseconds. Default: undefined (automatic). */

@@ -808,36 +1084,42 @@ poll?: number | boolean;

interface StatsOptions {
/** context directory for request shortening */
context?: boolean;
/** add the hash of the compilation */
hash?: boolean;
/** add webpack version information */
version?: boolean;
/** add timing information */
timings?: boolean;
/** add assets information */
/** Add asset Information */
assets?: boolean;
/** add chunk information */
/** Sort assets by a field */
assetsSort?: string;
/** Add information about cached (not built) modules */
cached?: boolean;
/** Add children information */
children?: boolean;
/** Add chunk information (setting this to `false` allows for a less verbose output) */
chunks?: boolean;
/** add built modules information to chunk information */
/** Add built modules information to chunk information */
chunkModules?: boolean;
/** add built modules information */
/** Add the origins of chunks and chunk merging info */
chunkOrigins?: boolean;
/** Sort the chunks by a field */
chunksSort?: string;
/** Context directory for request shortening */
context?: string;
/** Add errors */
errors?: boolean;
/** Add details to errors (like resolving log) */
errorDetails?: boolean;
/** Add the hash of the compilation */
hash?: boolean;
/** Add built modules information */
modules?: boolean;
/** add children information */
children?: boolean;
/** add also information about cached (not built) modules */
cached?: boolean;
/** add information about the reasons why modules are included */
/** Sort the modules by a field */
modulesSort?: string;
/** Add public path information */
publicPath?: boolean;
/** Add information about the reasons why modules are included */
reasons?: boolean;
/** add the source code of modules */
/** Add the source code of modules */
source?: boolean;
/** add details to errors (like resolving log) */
errorDetails?: boolean;
/** add the origins of chunks and chunk merging info */
chunkOrigins?: boolean;
/** sort the modules by that field */
modulesSort?: string;
/** sort the chunks by that field */
chunksSort?: string;
/** sort the assets by that field */
assetsSort?: string;
/** Add timing information */
timings?: boolean;
/** Add webpack version information */
version?: boolean;
/** Add warnings */
warnings?: boolean;
}

@@ -844,0 +1126,0 @@

9

webpack/package.json
{
"name": "@types/webpack",
"version": "2.2.1",
"version": "2.2.2",
"description": "TypeScript definitions for webpack",
"license": "MIT",
"author": "Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>",
"author": "Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>",
"main": "",

@@ -15,7 +15,8 @@ "repository": {

"@types/uglify-js": "*",
"@types/tapable": "*"
"@types/tapable": "*",
"@types/node": "*"
},
"peerDependencies": {},
"typesPublisherContentHash": "1ff4a8112e08def99d33837601e36e5f8b1e464553044e293626970d0ca99d31",
"typesPublisherContentHash": "6316e4df7c19573a75b83ae8b3eec0fac91996424fec85aba130e042f514a67c",
"typeScriptVersion": "2.0"
}

@@ -11,7 +11,7 @@ # Installation

Additional Details
* Last updated: Tue, 17 Jan 2017 06:31:27 GMT
* Dependencies: uglify-js, tapable
* Last updated: Thu, 19 Jan 2017 14:46:20 GMT
* Dependencies: uglify-js, tapable, node
* Global values: none
# Credits
These definitions were written by Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>.
These definitions were written by Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>.

@@ -6,6 +6,7 @@ {

"data": {
"authors": "Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>",
"authors": "Qubo <https://github.com/tkqubo>, Matt Lewis <https://github.com/mattlewis92>, Benjamin Lim <https://github.com/bumbleblym>, Boris Cherny <https://github.com/bcherny>",
"dependencies": {
"uglify-js": "*",
"tapable": "*"
"tapable": "*",
"node": "*"
},

@@ -28,5 +29,5 @@ "pathMappings": {},

"hasPackageJson": false,
"contentHash": "1ff4a8112e08def99d33837601e36e5f8b1e464553044e293626970d0ca99d31"
"contentHash": "6316e4df7c19573a75b83ae8b3eec0fac91996424fec85aba130e042f514a67c"
},
"isLatest": true
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc