Interface: WebpackConfig

tasks.WebpackConfig

Extended configuration for Webpack. Has options for build package’s built-in uglify and sourcemaps support.

Hierarchy

  • Configuration

    WebpackConfig

Properties

amd

Optional amd: false | { [index: string]: any; }

Set the value of require.amd and define.amd. Or disable AMD support.

Inherited from

webpackModule.Configuration.amd


bail

Optional bail: boolean

Report the first error as a hard error instead of tolerating it.

Inherited from

webpackModule.Configuration.bail


cache

Optional cache: boolean | FileCacheOptions | MemoryCacheOptions

Cache generated modules and chunks to improve performance for multiple incremental builds.

Inherited from

webpackModule.Configuration.cache


context

Optional context: string

The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.

Inherited from

webpackModule.Configuration.context


dependencies

Optional dependencies: string[]

References to other configurations to depend on.

Inherited from

webpackModule.Configuration.dependencies


devtool

Optional devtool: string | false

A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).

Inherited from

webpackModule.Configuration.devtool


dotenv

Optional dotenv: boolean

Inject dotenv package to load environment variables from env files. The env file(s) should be located next to the entry point(s) during runtime.

Note that the files are called env instead of the traditional .env to allow Serverless to deploy them.

This will only work for node target and is meant to be used with environments that do not support regular environment variables, such as AWS Lambda@Edge.

Defaults to false.


entry

Optional entry: string | string[] | EntryObject | () => string | string[] | EntryObject | Promise<EntryStatic>

The entry point(s) of the compilation.

Inherited from

webpackModule.Configuration.entry


experiments

Optional experiments: Experiments

Enables/Disables experiments (experimental features with relax SemVer compatibility).

Inherited from

webpackModule.Configuration.experiments


extends

Optional extends: string | string[]

Extend configuration from another configuration (only works when using webpack-cli).

Inherited from

webpackModule.Configuration.extends


externals

Optional externals: string | RegExp | ExternalItemObjectKnown & ExternalItemObjectUnknown | ExternalItem[] | (data: ExternalItemFunctionData, callback: (err?: null | Error, result?: string | boolean | string[] | { [index: string]: any; }) => void) => void | (data: ExternalItemFunctionData) => Promise<ExternalItemValue>

Specify dependencies that shouldn’t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on output.libraryTarget.

Inherited from

webpackModule.Configuration.externals


externalsPresets

Optional externalsPresets: ExternalsPresets

Enable presets of externals for specific targets.

Inherited from

webpackModule.Configuration.externalsPresets


externalsType

Optional externalsType: "window" | "promise" | "module" | "script" | "var" | "self" | "global" | "import" | "commonjs" | "amd" | "system" | "umd" | "assign" | "this" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "jsonp" | "node-commonjs"

Specifies the default type of externals (‘amd*’, ‘umd*’, ‘system’ and ‘jsonp’ depend on output.libraryTarget set to the same value).

Inherited from

webpackModule.Configuration.externalsType


ignoreWarnings

Optional ignoreWarnings: (RegExp | { file?: RegExp ; message?: RegExp ; module?: RegExp } | (warning: WebpackError, compilation: Compilation) => boolean)[]

Ignore specific warnings.

Inherited from

webpackModule.Configuration.ignoreWarnings


infrastructureLogging

Optional infrastructureLogging: InfrastructureLogging

Options for infrastructure level logging.

Inherited from

webpackModule.Configuration.infrastructureLogging


loader

Optional loader: Loader

Custom values available in the loader context.

Inherited from

webpackModule.Configuration.loader


mode

Optional mode: "none" | "production" | "development"

Enable production optimizations or development hints.

Inherited from

webpackModule.Configuration.mode


module

Optional module: ModuleOptions

Options affecting the normal modules (NormalModuleFactory).

Inherited from

webpackModule.Configuration.module


name

Optional name: string

Name of the configuration. Used when loading multiple configurations.

Inherited from

webpackModule.Configuration.name


node

Optional node: false | NodeOptions

Include polyfills or mocks for various node stuff.

Inherited from

webpackModule.Configuration.node


optimization

Optional optimization: Optimization

Enables/Disables integrated optimizations.

Inherited from

webpackModule.Configuration.optimization


output

Optional output: Output

Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.

Inherited from

webpackModule.Configuration.output


parallelism

Optional parallelism: number

The number of parallel processed modules in the compilation.

Inherited from

webpackModule.Configuration.parallelism


performance

Optional performance: false | PerformanceOptions

Configuration for web performance recommendations.

Inherited from

webpackModule.Configuration.performance


plugins

Optional plugins: (undefined | null | false | "" | 0 | WebpackPluginInstance | (this: Compiler, compiler: Compiler) => void)[]

Add additional plugins to the compiler.

Inherited from

webpackModule.Configuration.plugins


profile

Optional profile: boolean

Capture timing information for each module.

Inherited from

webpackModule.Configuration.profile


recordsInputPath

Optional recordsInputPath: string | false

Store compiler state to a json file.

Inherited from

webpackModule.Configuration.recordsInputPath


recordsOutputPath

Optional recordsOutputPath: string | false

Load compiler state from a json file.

Inherited from

webpackModule.Configuration.recordsOutputPath


recordsPath

Optional recordsPath: string | false

Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. recordsPath is used for recordsInputPath and recordsOutputPath if they left undefined.

Inherited from

webpackModule.Configuration.recordsPath


resolve

Optional resolve: ResolveOptionsWebpackOptions

Options for the resolver.

Inherited from

webpackModule.Configuration.resolve


resolveLoader

Optional resolveLoader: ResolveOptionsWebpackOptions

Options for the resolver when resolving loaders.

Inherited from

webpackModule.Configuration.resolveLoader


snapshot

Optional snapshot: SnapshotOptionsWebpackOptions

Options affecting how file system snapshots are created and validated.

Inherited from

webpackModule.Configuration.snapshot


sourcemaps

Optional sourcemaps: boolean

Generate sourcemaps. Defaults to false for production builds and true for others.


stats

Optional stats: boolean | "normal" | "none" | "summary" | "detailed" | StatsOptions | "verbose" | "errors-only" | "errors-warnings" | "minimal"

Stats options object or preset name.

Inherited from

webpackModule.Configuration.stats


target

Optional target: string | false | string[]

Environment to build for. An array of environments to build for all of them when possible.

Inherited from

webpackModule.Configuration.target


uglify

Optional uglify: boolean

Uglify compiled JavaScript. Defaults to true for production builds and false for others.


watch

Optional watch: boolean

Enter watch mode, which rebuilds on file change.

Inherited from

webpackModule.Configuration.watch


watchOptions

Optional watchOptions: WatchOptions

Options for the watcher.

Inherited from

webpackModule.Configuration.watchOptions