@types/webpack
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -8,5 +8,19 @@ // Type definitions for webpack 2.2 | ||
import * as Tapable from 'tapable'; | ||
import * as UglifyJS from 'uglify-js'; | ||
import * as tapable from 'tapable'; | ||
export = webpack; | ||
declare function webpack( | ||
options: webpack.Configuration, | ||
handler: webpack.Compiler.Handler | ||
): webpack.Compiler.Watching | webpack.Compiler; | ||
declare function webpack(options?: webpack.Configuration): webpack.Compiler; | ||
declare function webpack( | ||
options: webpack.Configuration[], | ||
handler: webpack.MultiCompiler.Handler | ||
): webpack.MultiWatching | webpack.MultiCompiler; | ||
declare function webpack(options: webpack.Configuration[]): webpack.MultiCompiler; | ||
declare namespace webpack { | ||
@@ -50,3 +64,3 @@ interface Configuration { | ||
watch?: boolean; | ||
watchOptions?: WatchOptions; | ||
watchOptions?: Options.WatchOptions; | ||
/** Switch loaders to debug mode. */ | ||
@@ -69,5 +83,5 @@ debug?: boolean; | ||
/** Stats options for logging */ | ||
stats?: compiler.StatsToStringOptions; | ||
stats?: Options.Stats; | ||
/** Performance options */ | ||
performance?: PerformanceOptions; | ||
performance?: Options.Performance; | ||
} | ||
@@ -330,11 +344,2 @@ | ||
interface WatchOptions { | ||
/** Delay the rebuilt after the first change. Value is a time in ms. */ | ||
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 */ | ||
poll?: boolean | number; | ||
} | ||
interface Node { | ||
@@ -475,281 +480,333 @@ console?: boolean; | ||
interface Plugin extends tapable.Plugin { | ||
apply(thisArg: Webpack, ...args: any[]): void; | ||
namespace Options { | ||
interface Performance { | ||
/** This property allows webpack to control what files are used to calculate performance hints. */ | ||
assetFilter?(assetFilename: string): boolean; | ||
/** | ||
* Turns hints on/off. In addition, tells webpack to throw either an error or a warning when hints are | ||
* found. This property is set to "warning" by default. | ||
*/ | ||
hints?: 'warning' | 'error' | boolean; | ||
/** | ||
* An asset is any emitted file from webpack. This option controls when webpack emits a performance hint | ||
* based on individual asset size. The default value is 250000 (bytes). | ||
*/ | ||
maxAssetSize?: number; | ||
/** | ||
* An entrypoint represents all assets that would be utilized during initial load time for a specific entry. | ||
* This option controls when webpack should emit performance hints based on the maximum entrypoint size. | ||
* The default value is 250000 (bytes). | ||
*/ | ||
maxEntrypointSize?: number; | ||
} | ||
type Stats = webpack.Stats.ToStringOptions; | ||
type WatchOptions = ICompiler.WatchOptions; | ||
} | ||
type UglifyCommentFunction = (astNode: any, comment: any) => boolean | ||
// tslint:disable-next-line:interface-name | ||
interface ICompiler { | ||
run(handler: ICompiler.Handler): void; | ||
watch(watchOptions: ICompiler.WatchOptions, handler: ICompiler.Handler): Watching; | ||
} | ||
interface UglifyPluginOptions extends UglifyJS.MinifyOptions { | ||
beautify?: boolean; | ||
comments?: boolean | RegExp | UglifyCommentFunction; | ||
sourceMap?: boolean; | ||
test?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
exclude?: Condition | Condition[]; | ||
namespace ICompiler { | ||
type Handler = (err: Error, stats: Stats) => void; | ||
interface WatchOptions { | ||
/** | ||
* Add a delay before rebuilding once the first file changed. This allows webpack to aggregate any other | ||
* changes made during this time period into one rebuild. | ||
* Pass a value in milliseconds. Default: 300. | ||
*/ | ||
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?: string | RegExp; | ||
/** Turn on polling by passing true, or specifying a poll interval in milliseconds. */ | ||
poll?: boolean | number; | ||
} | ||
} | ||
interface Webpack { | ||
(config: Configuration, callback?: compiler.CompilerCallback): compiler.Compiler; | ||
/** | ||
* optimize namespace | ||
*/ | ||
optimize: Optimize; | ||
/** | ||
* dependencies namespace | ||
*/ | ||
dependencies: Dependencies; | ||
/** | ||
* Replace resources that matches resourceRegExp with newResource. | ||
* If newResource is relative, it is resolve relative to the previous resource. | ||
* If newResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. | ||
*/ | ||
NormalModuleReplacementPlugin: NormalModuleReplacementPluginStatic; | ||
/** | ||
* Replaces the default resource, recursive flag or regExp generated by parsing with newContentResource, | ||
* newContentRecursive resp. newContextRegExp if the resource (directory) matches resourceRegExp. | ||
* If newContentResource is relative, it is resolve relative to the previous resource. | ||
* If newContentResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. | ||
*/ | ||
ContextReplacementPlugin: ContextReplacementPluginStatic; | ||
/** | ||
* Don’t generate modules for requests matching the provided RegExp. | ||
*/ | ||
IgnorePlugin: IgnorePluginStatic; | ||
/** | ||
* A request for a normal module, which is resolved and built even before a require to it occurs. | ||
* This can boost performance. Try to profile the build first to determine clever prefetching points. | ||
*/ | ||
PrefetchPlugin: PrefetchPluginStatic; | ||
/** | ||
* Apply a plugin (or array of plugins) to one or more resolvers (as specified in types). | ||
*/ | ||
ResolverPlugin: ResolverPluginStatic; | ||
/** | ||
* Adds a banner to the top of each generated chunk. | ||
*/ | ||
BannerPlugin: BannerPluginStatic; | ||
/** | ||
* Define free variables. Useful for having development builds with debug logging or adding global constants. | ||
*/ | ||
DefinePlugin: DefinePluginStatic; | ||
/** | ||
* Automatically loaded modules. | ||
* Module (value) is loaded when the identifier (key) is used as free variable in a module. | ||
* The identifier is filled with the exports of the loaded module. | ||
*/ | ||
ProvidePlugin: ProvidePluginStatic; | ||
/** | ||
* Adds SourceMaps for assets. | ||
*/ | ||
SourceMapDevToolPlugin: SourceMapDevToolPluginStatic; | ||
/** | ||
* Adds SourceMaps for assets, but wrapped inside eval statements. | ||
* Much faster incremental build speed, but harder to debug. | ||
*/ | ||
EvalSourceMapDevToolPlugin: EvalSourceMapDevToolPluginStatic; | ||
/** | ||
* Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath) | ||
* Generates Hot Update Chunks of each chunk in the records. | ||
* It also enables the API and makes __webpack_hash__ available in the bundle. | ||
*/ | ||
HotModuleReplacementPlugin: HotModuleReplacementPluginStatic; | ||
/** | ||
* Adds useful free vars to the bundle. | ||
*/ | ||
ExtendedAPIPlugin: ExtendedAPIPluginStatic; | ||
/** | ||
* When there are errors while compiling this plugin skips the emitting phase (and recording phase), | ||
* so there are no assets emitted that include errors. The emitted flag in the stats is false for all assets. | ||
*/ | ||
NoEmitOnErrorsPlugin: NoEmitOnErrorsPluginStatic; | ||
/** | ||
* Alias for NoEmitOnErrorsPlugin | ||
* @deprecated | ||
*/ | ||
NoErrorsPlugin: NoEmitOnErrorsPluginStatic; | ||
/** | ||
* Does not watch specified files matching provided paths or RegExps. | ||
*/ | ||
WatchIgnorePlugin: WatchIgnorePluginStatic; | ||
/** | ||
* Uses the module name as the module id inside the bundle, instead of a number. | ||
* Helps with debugging, but increases bundle size. | ||
*/ | ||
NamedModulesPlugin: NamedModulesPluginStatic; | ||
/** | ||
* Some loaders need context information and read them from the configuration. | ||
* This need to be passed via loader options in the long-term. See loader documentation for relevant options. | ||
* To keep compatibility with old loaders, these options can be passed via this plugin. | ||
*/ | ||
LoaderOptionsPlugin: LoaderOptionsPluginStatic; | ||
interface Watching { | ||
close(callback: () => void): void; | ||
invalidate(): void; | ||
} | ||
interface Optimize { | ||
/** | ||
* Search for equal or similar files and deduplicate them in the output. | ||
* This comes with some overhead for the entry chunk, but can reduce file size effectively. | ||
* This is experimental and may crash, because of some missing implementations. (Report an issue) | ||
*/ | ||
DedupePlugin: optimize.DedupePluginStatic; | ||
/** | ||
* Limit the chunk count to a defined value. Chunks are merged until it fits. | ||
*/ | ||
LimitChunkCountPlugin: optimize.LimitChunkCountPluginStatic; | ||
/** | ||
* Merge small chunks that are lower than this min size (in chars). Size is approximated. | ||
*/ | ||
MinChunkSizePlugin: optimize.MinChunkSizePluginStatic; | ||
/** | ||
* Assign the module and chunk ids by occurrence count. Ids that are used often get lower (shorter) ids. | ||
* This make ids predictable, reduces to total file size and is recommended. | ||
*/ | ||
// TODO: This is a typo, and will be removed in Webpack 2. | ||
OccurenceOrderPlugin: optimize.OccurenceOrderPluginStatic; | ||
OccurrenceOrderPlugin: optimize.OccurenceOrderPluginStatic; | ||
/** | ||
* Minimize all JavaScript output of chunks. Loaders are switched into minimizing mode. | ||
* You can pass an object containing UglifyJs options. | ||
*/ | ||
UglifyJsPlugin: optimize.UglifyJsPluginStatic; | ||
CommonsChunkPlugin: optimize.CommonsChunkPluginStatic; | ||
/** | ||
* A plugin for a more aggressive chunk merging strategy. | ||
* Even similar chunks are merged if the total size is reduced enough. | ||
* As an option modules that are not common in these chunks can be moved up the chunk tree to the parents. | ||
*/ | ||
AggressiveMergingPlugin: optimize.AggressiveMergingPluginStatic; | ||
class Compiler extends Tapable implements ICompiler { | ||
constructor(); | ||
name: string; | ||
options: Configuration; | ||
outputFileSystem: any; | ||
run(handler: Compiler.Handler): void; | ||
watch(watchOptions: Compiler.WatchOptions, handler: Compiler.Handler): Compiler.Watching; | ||
} | ||
interface Dependencies { | ||
/** | ||
* Support Labeled Modules. | ||
*/ | ||
LabeledModulesPlugin: dependencies.LabeledModulesPluginStatic; | ||
namespace Compiler { | ||
type Handler = ICompiler.Handler; | ||
type WatchOptions = ICompiler.WatchOptions; | ||
class Watching implements webpack.Watching { | ||
constructor(compiler: Compiler, watchOptions: Watching.WatchOptions, handler: Watching.Handler); | ||
close(callback: () => void): void; | ||
invalidate(): void; | ||
} | ||
namespace Watching { | ||
type WatchOptions = ICompiler.WatchOptions; | ||
type Handler = ICompiler.Handler; | ||
} | ||
} | ||
interface DirectoryDescriptionFilePluginStatic { | ||
new (file: string, files: string[]): Plugin; | ||
abstract class MultiCompiler implements ICompiler { | ||
run(handler: MultiCompiler.Handler): void; | ||
watch(watchOptions: MultiCompiler.WatchOptions, handler: MultiCompiler.Handler): MultiWatching; | ||
} | ||
interface NormalModuleReplacementPluginStatic { | ||
new (resourceRegExp: any, newResource: any): Plugin; | ||
namespace MultiCompiler { | ||
type Handler = ICompiler.Handler; | ||
type WatchOptions = ICompiler.WatchOptions; | ||
} | ||
interface ContextReplacementPluginStatic { | ||
new (resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): Plugin; | ||
abstract class MultiWatching implements Watching { | ||
close(callback: () => void): void; | ||
invalidate(): void; | ||
} | ||
interface IgnorePluginStatic { | ||
new (requestRegExp: any, contextRegExp?: any): Plugin; | ||
abstract class Plugin implements Tapable.Plugin { | ||
apply(compiler: Compiler): void; | ||
} | ||
interface PrefetchPluginStatic { | ||
// tslint:disable-next-line:unified-signatures | ||
new (context: any, request: any): Plugin; | ||
new (request: any): Plugin; | ||
abstract class Stats { | ||
/** Returns true if there were errors while compiling. */ | ||
hasErrors(): boolean; | ||
/** Returns true if there were warnings while compiling. */ | ||
hasWarnings(): boolean; | ||
/** Returns compilation information as a JSON object. */ | ||
toJson(options?: Stats.ToJsonOptions): any; | ||
/** Returns a formatted string of the compilation information (similar to CLI output). */ | ||
toString(options?: Stats.ToStringOptions): string; | ||
} | ||
interface ResolverPluginStatic { | ||
new (plugins: Plugin[], files?: string[]): Plugin; | ||
DirectoryDescriptionFilePlugin: DirectoryDescriptionFilePluginStatic; | ||
/** | ||
* This plugin will append a path to the module directory to find a match, | ||
* which can be useful if you have a module which has an incorrect “main” entry in its package.json/bower.json etc (e.g. "main": "Gruntfile.js"). | ||
* You can use this plugin as a special case to load the correct file for this module. Example: | ||
*/ | ||
FileAppendPlugin: FileAppendPluginStatic; | ||
namespace Stats { | ||
type Preset | ||
= boolean | ||
| 'errors-only' | ||
| 'minimal' | ||
| 'none' | ||
| 'normal' | ||
| 'verbose'; | ||
interface ToJsonOptionsObject { | ||
/** Add asset Information */ | ||
assets?: boolean; | ||
/** Sort assets by a field */ | ||
assetsSort?: string; | ||
/** Add information about cached (not built) modules */ | ||
cached?: boolean; | ||
/** Add children information */ | ||
children?: boolean; | ||
/** Add built modules information to chunk information */ | ||
chunkModules?: boolean; | ||
/** Add the origins of chunks and chunk merging info */ | ||
chunkOrigins?: boolean; | ||
/** Add chunk information (setting this to `false` allows for a less verbose output) */ | ||
chunks?: boolean; | ||
/** Sort the chunks by a field */ | ||
chunksSort?: string; | ||
/** Context directory for request shortening */ | ||
context?: string; | ||
/** Add details to errors (like resolving log) */ | ||
errorDetails?: boolean; | ||
/** Add errors */ | ||
errors?: boolean; | ||
/** Add the hash of the compilation */ | ||
hash?: boolean; | ||
/** Add built modules information */ | ||
modules?: boolean; | ||
/** 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 */ | ||
source?: boolean; | ||
/** Add timing information */ | ||
timings?: boolean; | ||
/** Add webpack version information */ | ||
version?: boolean; | ||
/** Add warnings */ | ||
warnings?: boolean; | ||
} | ||
type ToJsonOptions = Preset | ToJsonOptionsObject; | ||
interface ToStringOptionsObject extends ToJsonOptionsObject { | ||
/** `webpack --colors` equivalent */ | ||
colors?: boolean; | ||
} | ||
type ToStringOptions = Preset | ToStringOptionsObject; | ||
} | ||
interface FileAppendPluginStatic { | ||
new (files: string[]): Plugin; | ||
/** | ||
* Plugins | ||
*/ | ||
class BannerPlugin extends Plugin { | ||
constructor(banner: any, options: any); | ||
} | ||
interface BannerPluginStatic { | ||
new (banner: any, options: any): Plugin; | ||
class ContextReplacementPlugin extends Plugin { | ||
constructor(resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any); | ||
} | ||
interface DefinePluginStatic { | ||
new (definitions: {[key: string]: any}): Plugin; | ||
class DefinePlugin extends Plugin { | ||
constructor(definitions: {[key: string]: any}); | ||
} | ||
interface ProvidePluginStatic { | ||
new (definitions: {[key: string]: any}): Plugin; | ||
class EvalSourceMapDevToolPlugin extends Plugin { | ||
constructor(options?: false | string | EvalSourceMapDevToolPlugin.Options); | ||
} | ||
interface SourceMapDevToolPluginStatic { | ||
// if string | false | null, maps to the filename option | ||
new (options?: string | false | null | SourceMapDevToolPluginOptions): Plugin; | ||
namespace EvalSourceMapDevToolPlugin { | ||
interface Options { | ||
append?: false | string; | ||
columns?: boolean; | ||
lineToLine?: boolean | { | ||
exclude?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
test?: Condition | Condition[]; | ||
}; | ||
module?: boolean; | ||
moduleFilenameTemplate?: string; | ||
sourceRoot?: string; | ||
} | ||
} | ||
interface SourceMapDevToolPluginOptions { | ||
// output filename pattern (false/null to append) | ||
filename?: string | false | null; | ||
// source map comment pattern (false to not append) | ||
append?: false | string; | ||
// template for the module filename inside the source map | ||
moduleFilenameTemplate?: string; | ||
// fallback used when the moduleFilenameTemplate produces a collision | ||
fallbackModuleFilenameTemplate?: string; | ||
// test/include/exclude files | ||
test?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
exclude?: Condition | Condition[]; | ||
// whether to include the footer comment with source information | ||
noSources?: boolean; | ||
// the source map sourceRoot ("The URL root from which all sources are relative.") | ||
sourceRoot?: string | null; | ||
// whether to generate per-module source map | ||
module?: boolean; | ||
// whether to include column information in the source map | ||
columns?: boolean; | ||
// whether to preserve line numbers between source and source map | ||
lineToLine?: boolean | { | ||
test?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
exclude?: Condition | Condition[]; | ||
}; | ||
class ExtendedAPIPlugin extends Plugin { | ||
constructor(); | ||
} | ||
interface EvalSourceMapDevToolPluginStatic { | ||
// if string | false, maps to the append option | ||
new (options?: string | false | EvalSourceMapDevToolPluginOptions): Plugin; | ||
class HotModuleReplacementPlugin extends Plugin { | ||
constructor(options?: any); | ||
} | ||
interface EvalSourceMapDevToolPluginOptions { | ||
append?: false | string; | ||
moduleFilenameTemplate?: string; | ||
sourceRoot?: string; | ||
module?: boolean; | ||
columns?: boolean; | ||
lineToLine?: boolean | { | ||
test?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
exclude?: Condition | Condition[]; | ||
}; | ||
class IgnorePlugin extends Plugin { | ||
constructor(requestRegExp: any, contextRegExp?: any); | ||
} | ||
interface HotModuleReplacementPluginStatic { | ||
new (options?: any): Plugin; | ||
class LoaderOptionsPlugin extends Plugin { | ||
constructor(options: any); | ||
} | ||
interface ExtendedAPIPluginStatic { | ||
new (): Plugin; | ||
class NamedModulesPlugin extends Plugin { | ||
constructor(); | ||
} | ||
interface NoEmitOnErrorsPluginStatic { | ||
new (): Plugin; | ||
class NoEmitOnErrorsPlugin extends Plugin { | ||
constructor(); | ||
} | ||
interface WatchIgnorePluginStatic { | ||
new (paths: RegExp[]): Plugin; | ||
/** @deprecated use webpack.NoEmitOnErrorsPlugin */ | ||
class NoErrorsPlugin extends Plugin { | ||
constructor(); | ||
} | ||
interface NamedModulesPluginStatic { | ||
new (): Plugin; | ||
class NormalModuleReplacementPlugin extends Plugin { | ||
constructor(resourceRegExp: any, newResource: any); | ||
} | ||
interface LoaderOptionsPluginStatic { | ||
new (options: any): Plugin; | ||
class PrefetchPlugin extends Plugin { | ||
// tslint:disable-next-line:unified-signatures | ||
constructor(context: any, request: any); | ||
constructor(request: any); | ||
} | ||
class ProvidePlugin extends Plugin { | ||
constructor(definitions: {[key: string]: any}); | ||
} | ||
class SourceMapDevToolPlugin extends Plugin { | ||
constructor(options?: null | false | string | SourceMapDevToolPlugin.Options); | ||
} | ||
namespace SourceMapDevToolPlugin { | ||
/** @todo extend EvalSourceMapDevToolPlugin.Options */ | ||
interface Options { | ||
append?: false | string; | ||
columns?: boolean; | ||
exclude?: Condition | Condition[]; | ||
fallbackModuleFilenameTemplate?: string; | ||
filename?: null | false | string; | ||
include?: Condition | Condition[]; | ||
lineToLine?: boolean | { | ||
exclude?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
test?: Condition | Condition[]; | ||
}; | ||
module?: boolean; | ||
moduleFilenameTemplate?: string; | ||
noSources?: boolean; | ||
sourceRoot?: null | string; | ||
test?: Condition | Condition[]; | ||
} | ||
} | ||
class WatchIgnorePlugin extends Plugin { | ||
constructor(paths: RegExp[]); | ||
} | ||
namespace optimize { | ||
class AggressiveMergingPlugin extends Plugin { | ||
constructor(options: any); | ||
} | ||
class CommonsChunkPlugin extends Plugin { | ||
constructor(options?: any); | ||
} | ||
/** @deprecated */ | ||
class DedupePlugin extends Plugin { | ||
constructor(); | ||
} | ||
class LimitChunkCountPlugin extends Plugin { | ||
constructor(options: any); | ||
} | ||
class MinChunkSizePlugin extends Plugin { | ||
constructor(options: any); | ||
} | ||
class OccurrenceOrderPlugin extends Plugin { | ||
constructor(preferEntry: boolean); | ||
} | ||
class UglifyJsPlugin extends Plugin { | ||
constructor(options?: UglifyJsPlugin.Options); | ||
} | ||
namespace UglifyJsPlugin { | ||
type CommentFilter = (astNode: any, comment: any) => boolean; | ||
interface Options extends UglifyJS.MinifyOptions { | ||
beautify?: boolean; | ||
comments?: boolean | RegExp | CommentFilter; | ||
exclude?: Condition | Condition[]; | ||
include?: Condition | Condition[]; | ||
sourceMap?: boolean; | ||
test?: Condition | Condition[]; | ||
} | ||
} | ||
} | ||
namespace dependencies { | ||
} | ||
namespace loader { | ||
@@ -818,3 +875,3 @@ | ||
callback: loaderCallback | void; | ||
callback: loaderCallback; | ||
@@ -841,12 +898,12 @@ | ||
* { request: "/abc/loader1.js?xyz", | ||
* path: "/abc/loader1.js", | ||
* query: "?xyz", | ||
* module: [Function] | ||
* }, | ||
* 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] | ||
* } | ||
*] | ||
* path: "/abc/node_modules/loader2/index.js", | ||
* query: "", | ||
* module: [Function] | ||
* } | ||
* ] | ||
*/ | ||
@@ -871,3 +928,3 @@ loaders: any[]; | ||
*/ | ||
resourcePath: string | ||
resourcePath: string; | ||
@@ -909,3 +966,3 @@ /** | ||
*/ | ||
resolve(context: string, request: string, callback: (err: Error, result: string) => void): any | ||
resolve(context: string, request: string, callback: (err: Error, result: string) => void): any; | ||
@@ -917,3 +974,3 @@ /** | ||
*/ | ||
resolveSync(context: string, request: string): string | ||
resolveSync(context: string, request: string): string; | ||
@@ -941,3 +998,3 @@ | ||
*/ | ||
addContextDependency(directory: string): void | ||
addContextDependency(directory: string): void; | ||
@@ -1005,3 +1062,3 @@ /** | ||
*/ | ||
emitFile(name: string, content: Buffer|String, sourceMap: any): void | ||
emitFile(name: string, content: Buffer|string, sourceMap: any): void; | ||
@@ -1022,3 +1079,3 @@ | ||
*/ | ||
_compiler: compiler.Compiler; | ||
_compiler: Compiler; | ||
@@ -1033,146 +1090,38 @@ | ||
namespace optimize { | ||
interface DedupePluginStatic { | ||
new (): Plugin; | ||
} | ||
interface LimitChunkCountPluginStatic { | ||
new (options: any): Plugin; | ||
} | ||
interface MinChunkSizePluginStatic { | ||
new (options: any): Plugin; | ||
} | ||
interface OccurenceOrderPluginStatic { | ||
new (preferEntry: boolean): Plugin; | ||
} | ||
interface UglifyJsPluginStatic { | ||
new (options?: UglifyPluginOptions): Plugin; | ||
} | ||
interface CommonsChunkPluginStatic { | ||
new (chunkName: string, filenames?: string | string[]): Plugin; | ||
new (options?: any): Plugin; | ||
} | ||
interface AggressiveMergingPluginStatic { | ||
new (options: any): Plugin; | ||
} | ||
} | ||
namespace dependencies { | ||
interface LabeledModulesPluginStatic { | ||
new (): Plugin; | ||
} | ||
} | ||
/** @deprecated */ | ||
namespace compiler { | ||
interface Compiler { | ||
/** Builds the bundle(s). */ | ||
run(callback: CompilerCallback): void; | ||
/** | ||
* Builds the bundle(s) then starts the watcher, which rebuilds bundles whenever their source files change. | ||
* Returns a Watching instance. Note: since this will automatically run an initial build, so you only need to run watch (and not run). | ||
*/ | ||
watch(watchOptions: WatchOptions, handler: CompilerCallback): Watching; | ||
//TODO: below are some of the undocumented properties. needs typings | ||
outputFileSystem: any; | ||
name: string; | ||
options: Configuration; | ||
} | ||
/** @deprecated use webpack.Compiler */ | ||
type Compiler = webpack.Compiler; | ||
interface Watching { | ||
close(callback: () => void): void; | ||
} | ||
/** @deprecated use webpack.Compiler.Watching */ | ||
type Watching = webpack.Compiler.Watching; | ||
interface WatchOptions { | ||
/** After a change the watcher waits that time (in milliseconds) for more changes. Default: 300. */ | ||
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). */ | ||
poll?: number | boolean; | ||
} | ||
/** @deprecated use webpack.Compiler.WatchOptions */ | ||
type WatchOptions = webpack.Compiler.WatchOptions; | ||
interface Stats { | ||
/** Returns true if there were errors while compiling */ | ||
hasErrors(): boolean; | ||
/** Returns true if there were warnings while compiling. */ | ||
hasWarnings(): boolean; | ||
/** Return information as json object */ | ||
toJson(options?: StatsOptions): any; //TODO: type this | ||
/** Returns a formatted string of the result. */ | ||
toString(options?: StatsToStringOptions): string; | ||
} | ||
/** @deprecated use webpack.Stats */ | ||
type Stats = webpack.Stats; | ||
interface StatsOptions { | ||
/** Add asset Information */ | ||
assets?: boolean; | ||
/** 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 */ | ||
chunkModules?: boolean; | ||
/** 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; | ||
/** 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 */ | ||
source?: boolean; | ||
/** Add timing information */ | ||
timings?: boolean; | ||
/** Add webpack version information */ | ||
version?: boolean; | ||
/** Add warnings */ | ||
warnings?: boolean; | ||
} | ||
/** @deprecated use webpack.Stats.ToJsonOptions */ | ||
type StatsOptions = webpack.Stats.ToJsonOptions; | ||
interface StatsToStringOptions extends StatsOptions { | ||
/** With console colors */ | ||
colors?: boolean; | ||
} | ||
/** @deprecated use webpack.Stats.ToStringOptions */ | ||
type StatsToStringOptions = webpack.Stats.ToStringOptions; | ||
type CompilerCallback = (err: Error, stats: Stats) => void; | ||
/** @deprecated use webpack.Compiler.Handler */ | ||
type CompilerCallback = webpack.Compiler.Handler; | ||
} | ||
interface PerformanceOptions { | ||
/** | ||
* Turns hints on/off. In addition, tells webpack to throw either an error or a warning when hints are found. This property is set to "warning" by default. | ||
*/ | ||
hints?: boolean | 'error' | 'warning'; | ||
/** | ||
* An entrypoint represents all assets that would be utilized during initial load time for a specific entry. This option controls when webpack should emit performance hints based on the maximum entrypoint size. The default value is 250000 (bytes). | ||
*/ | ||
maxEntrypointSize?: number; | ||
/** | ||
* An asset is any emitted file from webpack. This option controls when webpack emits a performance hint based on individual asset size. The default value is 250000 (bytes). | ||
*/ | ||
maxAssetSize?: number; | ||
/** | ||
* This property allows webpack to control what files are used to calculate performance hints. | ||
*/ | ||
assetFilter?: (assetFilename: string) => boolean; | ||
} | ||
/** @deprecated use webpack.Options.Performance */ | ||
type PerformanceOptions = webpack.Options.Performance; | ||
/** @deprecated use webpack.Options.WatchOptions */ | ||
type WatchOptions = webpack.Options.WatchOptions; | ||
/** @deprecated use webpack.EvalSourceMapDevToolPlugin.Options */ | ||
type EvalSourceMapDevToolPluginOptions = webpack.EvalSourceMapDevToolPlugin.Options; | ||
/** @deprecated use webpack.SourceMapDevToolPlugin.Options */ | ||
type SourceMapDevToolPluginOptions = webpack.SourceMapDevToolPlugin.Options; | ||
/** @deprecated use webpack.optimize.UglifyJsPlugin.CommentFilter */ | ||
type UglifyCommentFunction = webpack.optimize.UglifyJsPlugin.CommentFilter; | ||
/** @deprecated use webpack.optimize.UglifyJsPlugin.Options */ | ||
type UglifyPluginOptions = webpack.optimize.UglifyJsPlugin.Options; | ||
} | ||
declare var webpack: webpack.Webpack; | ||
//export default webpack; | ||
export = webpack; |
{ | ||
"name": "@types/webpack", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "TypeScript definitions for webpack", | ||
@@ -14,9 +14,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/tapable": "*", | ||
"@types/uglify-js": "*", | ||
"@types/tapable": "*", | ||
"@types/node": "*" | ||
}, | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "836b2bd96568cb3226dd6a8424c1899a2be3f75d3474899bdb28f5bf38d44c95", | ||
"typesPublisherContentHash": "c3aaff80668ad99c15a074ac69583164ee5223dc0e1b7c2dd3c2f34b7c6ca15c", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 25 Jan 2017 00:43:57 GMT | ||
* Dependencies: uglify-js, tapable, node | ||
* Last updated: Tue, 07 Feb 2017 20:53:03 GMT | ||
* Dependencies: tapable, uglify-js, node | ||
* Global values: none | ||
@@ -15,0 +15,0 @@ |
@@ -8,4 +8,4 @@ { | ||
"dependencies": { | ||
"tapable": "*", | ||
"uglify-js": "*", | ||
"tapable": "*", | ||
"node": "*" | ||
@@ -29,5 +29,5 @@ }, | ||
"hasPackageJson": false, | ||
"contentHash": "836b2bd96568cb3226dd6a8424c1899a2be3f75d3474899bdb28f5bf38d44c95" | ||
"contentHash": "c3aaff80668ad99c15a074ac69583164ee5223dc0e1b7c2dd3c2f34b7c6ca15c" | ||
}, | ||
"isLatest": true | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46256
999