diff --git a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts index b02c707d81..838ac825ea 100644 --- a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts +++ b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts @@ -8,15 +8,21 @@ const config: webpack.Configuration = { filename: 'assets.json' }), new AssetsPlugin({ + entrypoints: true, filename: 'assets.json', fullPath: false, + fileTypes: ['css'], includeManifest: true, + includeAllFileTypes: false, + keepInMemory: true, + manifestFirst: true, path: '/foo/bar', prettyPrint: true, processOutput: (assets) => ( 'window.assets = ' + JSON.stringify(assets) ), update: true, + useCompilerPath: true, metadata: { meta: 'data' }, diff --git a/types/assets-webpack-plugin/index.d.ts b/types/assets-webpack-plugin/index.d.ts index 63563d6298..397002add3 100644 --- a/types/assets-webpack-plugin/index.d.ts +++ b/types/assets-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for assets-webpack-plugin 3.5 +// Type definitions for assets-webpack-plugin 3.9 // Project: https://github.com/ztoben/assets-webpack-plugin // Definitions by: Michael Strobel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,18 +16,36 @@ declare namespace AssetsWebpackPlugin { type ProcessOutputFn = (assets: Assets) => string; interface Options { + /** + * If the "entrypoints" option is given, the output will be limited to the entrypoints and the chunks associated with them. + * false by default + */ + entrypoints?: boolean; + /** * Name for the created json file. * "webpack-assets.json" by default */ filename?: string; + /** + * When set and "includeAllFileTypes" is set false, only assets matching these types will be included in the assets file. + * ['js', 'css'] by default + */ + fileTypes?: string[]; + /** * If false the output will not include the full path of the generated file. * true by default */ fullPath?: boolean; + /** + * When set false, falls back to the "fileTypes" option array to decide which file types to include in the assets file. + * true by default + */ + includeAllFileTypes?: boolean; + /** * Inserts the manifest javascript as a text property in your assets. * Accepts the name of your manifest chunk. @@ -38,6 +56,19 @@ declare namespace AssetsWebpackPlugin { */ includeManifest?: boolean; + /** + * When set the assets file will only be generated in memory while running webpack-dev-server and not written to disk. + * false by default + */ + keepInMemory?: boolean; + + /** + * Orders the assets output so that manifest is the first entry. + * This is useful for cases where script tags are generated from the assets json output, and order of import is important. + * false by default + */ + manifestFirst?: boolean; + /** * Inject metadata into the output file. All values will be injected into the key "metadata" */ @@ -66,6 +97,12 @@ declare namespace AssetsWebpackPlugin { * false by default */ update?: boolean; + + /** + * Will override the path to use the compiler output path set in your webpack config. + * false by default + */ + useCompilerPath?: boolean; } }