Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
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: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 0 additions & 23 deletions lib/configs/__tests__/createStyleguideConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
36 changes: 0 additions & 36 deletions lib/configs/createStyleguideConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down