diff --git a/src/options.json b/src/options.json index 0895597f..ce594891 100644 --- a/src/options.json +++ b/src/options.json @@ -122,10 +122,6 @@ } ] }, - "icss": { - "description": "Enables/Disables handling the CSS module interoperable import/export format ((https://github.com/webpack-contrib/css-loader#icss)", - "type": "boolean" - }, "sourceMap": { "description": "Enables/Disables generation of source maps (https://github.com/webpack-contrib/css-loader#sourcemap).", "type": "boolean" diff --git a/src/utils.js b/src/utils.js index 9b506818..67e50566 100644 --- a/src/utils.js +++ b/src/utils.js @@ -219,8 +219,6 @@ function normalizeOptions(rawOptions, loaderContext) { url: typeof rawOptions.url === 'undefined' ? true : rawOptions.url, import: typeof rawOptions.import === 'undefined' ? true : rawOptions.import, modules: modulesOptions, - // TODO remove in the next major release - icss: typeof rawOptions.icss === 'undefined' ? false : rawOptions.icss, sourceMap: typeof rawOptions.sourceMap === 'boolean' ? rawOptions.sourceMap diff --git a/test/__snapshots__/modules-option.test.js.snap b/test/__snapshots__/modules-option.test.js.snap index 087eba1e..7e4dfd8b 100644 --- a/test/__snapshots__/modules-option.test.js.snap +++ b/test/__snapshots__/modules-option.test.js.snap @@ -12529,52 +12529,6 @@ Array [ exports[`"modules" option should work with the \`exportGlobals\` option (the \`mode\` option is \`pure\`): warnings 1`] = `Array []`; -exports[`"modules" option show work and warn about the "icss" option deprecation: errors 1`] = `Array []`; - -exports[`"modules" option show work and warn about the "icss" option deprecation: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../../../../src/runtime/api.js\\"; -import ___CSS_LOADER_ICSS_IMPORT_0___ from \\"-!../../../../../../src/index.js??[ident]!./vars.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".className {\\\\n color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"primary-color\\"] + \\";\\\\n}\\\\n\\", \\"\\"]); -// Exports -___CSS_LOADER_EXPORT___.locals = { - \\"primary-color\\": \\"\\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"primary-color\\"] + \\"\\" -}; -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"modules" option show work and warn about the "icss" option deprecation: result 1`] = ` -Array [ - Array [ - "../../src/index.js?[ident]!./modules/icss/tests-cases/import/vars.css", - " -", - "", - ], - Array [ - "./modules/icss/tests-cases/import/source.css", - ".className { - color: red; -} -", - "", - ], -] -`; - -exports[`"modules" option show work and warn about the "icss" option deprecation: warnings 1`] = ` -Array [ - "ModuleWarning: Module Warning (from \`replaced original path\`): -The \\"icss\\" option is deprecated, use \\"modules.compileType: \\"icss\\"\\" instead", - "ModuleWarning: Module Warning (from \`replaced original path\`): -The \\"icss\\" option is deprecated, use \\"modules.compileType: \\"icss\\"\\" instead", -] -`; - exports[`"modules" option show work with the "compileType" and "exportOnlyLocals" options: errors 1`] = `Array []`; exports[`"modules" option show work with the "compileType" and "exportOnlyLocals" options: module 1`] = ` diff --git a/test/__snapshots__/validate-options.test.js.snap b/test/__snapshots__/validate-options.test.js.snap index f3f6ecc4..f8a113dd 100644 --- a/test/__snapshots__/validate-options.test.js.snap +++ b/test/__snapshots__/validate-options.test.js.snap @@ -6,18 +6,6 @@ exports[`validate options should throw an error on the "esModule" option with "t -> Use the ES modules syntax (https://github.com/webpack-contrib/css-loader#esmodule)." `; -exports[`validate options should throw an error on the "icss" option with "1" value 1`] = ` -"Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - - options.icss should be a boolean. - -> Enables/Disables handling the CSS module interoperable import/export format ((https://github.com/webpack-contrib/css-loader#icss)" -`; - -exports[`validate options should throw an error on the "icss" option with "true" value 1`] = ` -"Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - - options.icss should be a boolean. - -> Enables/Disables handling the CSS module interoperable import/export format ((https://github.com/webpack-contrib/css-loader#icss)" -`; - exports[`validate options should throw an error on the "import" option with "true" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options.import should be one of these: @@ -245,49 +233,49 @@ exports[`validate options should throw an error on the "sourceMap" option with " exports[`validate options should throw an error on the "unknown" option with "/test/" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "[]" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "{"foo":"bar"}" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "{}" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "1" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "false" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "test" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "unknown" option with "true" value 1`] = ` "Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'unknown'. These properties are valid: - object { url?, import?, modules?, icss?, sourceMap?, importLoaders?, esModule? }" + object { url?, import?, modules?, sourceMap?, importLoaders?, esModule? }" `; exports[`validate options should throw an error on the "url" option with "true" value 1`] = ` diff --git a/test/modules-option.test.js b/test/modules-option.test.js index 3fe8f558..44276e1b 100644 --- a/test/modules-option.test.js +++ b/test/modules-option.test.js @@ -1239,25 +1239,6 @@ describe('"modules" option', () => { }); }); - it('show work and warn about the "icss" option deprecation', async () => { - const compiler = getCompiler( - './modules/icss/tests-cases/import/source.js', - { - icss: true, - } - ); - const stats = await compile(compiler); - - expect( - getModuleSource('./modules/icss/tests-cases/import/source.css', stats) - ).toMatchSnapshot('module'); - expect(getExecutedCode('main.bundle.js', compiler, stats)).toMatchSnapshot( - 'result' - ); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - }); - it('show work with the "compileType" and "exportOnlyLocals" options', async () => { const compiler = getCompiler( './modules/icss/tests-cases/import/source.js', diff --git a/test/validate-options.test.js b/test/validate-options.test.js index 95c50fc7..748c8c56 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -10,10 +10,6 @@ describe('validate options', () => { success: [true, false, () => {}], failure: ['true'], }, - icss: { - success: [true, false], - failure: ['true', 1], - }, modules: { success: [ true,