Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/test/fixtures
/test/cases/*/expected
/test/js
*.d.ts
CHANGELOG.md
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"defaults": "webpack-defaults"
},
"files": [
"dist"
"dist",
"types.d.ts"
],
"peerDependencies": {
"webpack": "^4.4.0 || ^5.0.0"
Expand Down
45 changes: 45 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { compilation, Compiler, Plugin } from "webpack";

/**
* Lightweight CSS extraction webpack plugin
* This plugin extract CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps.
* Configuration Detail: https://github.com/webpack-contrib/mini-css-extract-plugin#configuration
*/
declare class MiniCssExtractPlugin extends Plugin {
/** webpack loader used always at the end of loaders list */
static loader: string;

constructor(options?: MiniCssExtractPlugin.PluginOptions);
apply(compiler: Compiler): void;
}

declare namespace MiniCssExtractPlugin {
interface PluginOptions {
/**
* Options similar to the same options in webpackOptions.output, both options are optional
* May contain `[name]`, `[id]`, `hash` and `[chunkhash]`
*/
filename?: string;
chunkFilename?: string;
/**
* For projects where CSS ordering has been mitigated through consistent
* use of scoping or naming conventions, the CSS order warnings can be
* disabled by setting this flag to true for the plugin.
*/
ignoreOrder?: boolean;
/**
* By default, mini-css-extract-plugin generates JS modules that use the CommonJS
* modules syntax. There are some cases in which using ES modules is beneficial,
* like in the case of module concatenation and tree shaking.
*/
esModule?: boolean;
/**
* With the `moduleFilename` option you can use chunk data to customize the filename.
* This is particularly useful when dealing with multiple entry points
* and wanting to get more control out of the filename for a given entry point/chunk
*/
moduleFilename?: (chunk: compilation.Chunk) => string;
}
}

export = MiniCssExtractPlugin;