From 3704937200f308628c8f6c3795ca91c6c9e58124 Mon Sep 17 00:00:00 2001 From: Kris Ellery Date: Wed, 22 Dec 2021 10:05:06 -0600 Subject: [PATCH] build!: drop IE11 support --- README.md | 1 - .../__tests__/createStyleguideConfig.test.js | 23 ------------ lib/configs/createStyleguideConfig.js | 36 ------------------- 3 files changed, 60 deletions(-) diff --git a/README.md b/README.md index 5afb912..39c75fd 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,6 @@ Creates a [React Styleguidist configuration object](https://react-styleguidist.j - `options.packageSection [boolean]` - Include `package.json` details as a top level section (default: `true`) - `options.packageSectionComponents [boolean]` - Include `components` configuration in the top-level package section (default: `false`) - `options.componentsSection [boolean]` - Include `components` configuration as its own separate section (default: `true`) -- `options.ie11Transforms [array]` - An array of additional modules that need babel transforms for IE11 compatibility ([#1327](https://github.com/styleguidist/react-styleguidist/pull/1327)) ## Linking Styleguides diff --git a/lib/configs/__tests__/createStyleguideConfig.test.js b/lib/configs/__tests__/createStyleguideConfig.test.js index db6f7b5..44e2306 100644 --- a/lib/configs/__tests__/createStyleguideConfig.test.js +++ b/lib/configs/__tests__/createStyleguideConfig.test.js @@ -95,29 +95,6 @@ describe('webpackConfig.resolve.alias', () => { }); }); -describe('IE 11 support for styleguidist artifacts', () => { - it('is configured at root level', () => { - const { webpackConfig } = createStyleguideConfig(); - expect(webpackConfig.module.rules[1]).toHaveProperty('use.options.presets', [ - [ - '@babel/preset-env', - { - modules: 'commonjs', - targets: { - ie: '11', - }, - }, - ], - ]); - }); - - it('is not configured in nested executions', () => { - process.env.creatingStyleguideConfig = __dirname; - const { webpackConfig } = createStyleguideConfig(); - expect(webpackConfig.module.rules).toHaveLength(1); - }); -}); - describe('circular-dependency-plugin', () => { it('is configured at root level', () => { const { webpackConfig } = createStyleguideConfig(); diff --git a/lib/configs/createStyleguideConfig.js b/lib/configs/createStyleguideConfig.js index 8500a72..63d7ba1 100644 --- a/lib/configs/createStyleguideConfig.js +++ b/lib/configs/createStyleguideConfig.js @@ -189,42 +189,6 @@ module.exports = (config = {}, options = {}) => { // only the root should alias singletons or check circularity if (isRootConfig()) { - // IE 11 support for styleguidist-generated artifacts - // https://github.com/styleguidist/react-styleguidist/pull/1327#issuecomment-483928457 - const ie11ModuleTransforms = [ - 'acorn-jsx', - 'estree-walker', - 'regexpu-core', - 'unicode-match-property-ecmascript', - 'unicode-match-property-value-ecmascript', - 'react-dev-utils', - 'ansi-styles', - 'ansi-regex', - 'chalk', - 'strip-ansi', - ...(options.ie11ModuleTransforms || []), - ]; - webpackConfig.module.rules.push({ - test: /\.jsx?$/, - include: new RegExp(`node_modules/(?=(${ie11ModuleTransforms.join('|')})/).*`), - use: { - loader: 'babel-loader', - options: { - presets: [ - [ - '@babel/preset-env', - { - modules: 'commonjs', - targets: { - ie: '11', - }, - }, - ], - ], - }, - }, - }); - webpackConfig.resolve = { alias: ['react', 'react-dom', 'styled-components'].reduce((acc, name) => { // resolvePkg does not throw if it cannot resolve, merely returns undefined