Add missing options

This commit is contained in:
Dmitry Filatov 2019-02-26 11:13:40 +03:00
parent 0e29f171fa
commit 765bff2e6a
2 changed files with 44 additions and 1 deletions

View File

@ -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'
},

View File

@ -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 <https://github.com/kryops>
// 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;
}
}