mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
Lazy load axe-core only when running tests
This commit is contained in:
parent
b4afd45ecf
commit
b5bddca8e4
@ -1,5 +1,4 @@
|
||||
import global from 'global';
|
||||
import axe from 'axe-core';
|
||||
import { addons } from '@storybook/addons';
|
||||
import { EVENTS } from './constants';
|
||||
import { A11yParameters } from './params';
|
||||
@ -40,6 +39,7 @@ const run = async (storyId: string) => {
|
||||
if (!active) {
|
||||
active = true;
|
||||
channel.emit(EVENTS.RUNNING);
|
||||
const axe = await import('axe-core');
|
||||
|
||||
const { element = getElement(), config, options = {} } = input;
|
||||
axe.reset();
|
||||
|
Loading…
x
Reference in New Issue
Block a user