From b12a3052a73a07fc83f91c5186fee30622eb3ebf Mon Sep 17 00:00:00 2001 From: Spencer Miskoviak <5247455+skovy@users.noreply.github.com> Date: Fri, 26 Jul 2019 10:53:25 -0700 Subject: [PATCH] Add the ignoreOrder option to MiniCssExtractPlugin (#37140) * Add the ignoreOrder option to MiniCssExtractPlugin * Fix linting issues * Update version number --- types/mini-css-extract-plugin/index.d.ts | 9 ++++++++- .../mini-css-extract-plugin-tests.ts | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/mini-css-extract-plugin/index.d.ts b/types/mini-css-extract-plugin/index.d.ts index 4e77ce0a2cb39c..a344aadc68b846 100644 --- a/types/mini-css-extract-plugin/index.d.ts +++ b/types/mini-css-extract-plugin/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for mini-css-extract-plugin 0.2 +// Type definitions for mini-css-extract-plugin 0.8 // Project: https://github.com/webpack-contrib/mini-css-extract-plugin // Definitions by: JounQin // Katsuya Hino +// Spencer Miskoviak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -27,6 +28,12 @@ declare namespace MiniCssExtractPlugin { */ 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; } } diff --git a/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts index b69c4f653caa98..8cd6e1d037a107 100644 --- a/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts +++ b/types/mini-css-extract-plugin/mini-css-extract-plugin-tests.ts @@ -65,3 +65,14 @@ configuration = { }), ], }; + +configuration = { + // ... + plugins: [ + new MiniCssExtractPlugin({ + filename: 'styles.css', + chunkFilename: 'style.css', + ignoreOrder: true, + }), + ], +};