mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 10:03:45 +03:00
chore: remove worker from main bundle for browser/standalone build
This commit is contained in:
parent
33eaf77dc5
commit
deffdc548e
|
@ -130,6 +130,7 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
|
|||
new ForkTsCheckerWebpackPlugin(),
|
||||
ignore(/js-yaml\/dumper\.js$/),
|
||||
ignore(/json-schema-ref-parser\/lib\/dereference\.js/),
|
||||
ignore(/^\.\/SearchWorker\.worker$/),
|
||||
new CopyWebpackPlugin(['demo/openapi.yaml']),
|
||||
],
|
||||
});
|
||||
|
|
|
@ -4,9 +4,9 @@ import * as React from 'react';
|
|||
import { MenuStore } from '../../services/MenuStore';
|
||||
import { RedocNormalizedOptions, RedocRawOptions } from '../../services/RedocNormalizedOptions';
|
||||
import styled, { media, withProps } from '../../styled-components';
|
||||
import { IS_BROWSER } from '../../utils/index';
|
||||
import { OptionsContext } from '../OptionsProvider';
|
||||
import { AnimatedChevronButton } from './ChevronSvg';
|
||||
import { IS_BROWSER } from '../../utils/index';
|
||||
|
||||
let Stickyfill;
|
||||
if (IS_BROWSER) {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { IS_BROWSER } from '../utils/';
|
||||
import { IMenuItem } from './MenuStore';
|
||||
import { OperationModel } from './models';
|
||||
import { IS_BROWSER } from '../utils/';
|
||||
|
||||
let worker;
|
||||
|
||||
if (IS_BROWSER) {
|
||||
try {
|
||||
// tslint:disable-next-line
|
||||
worker = require('workerize-loader?inline&fallback=false!./SearchWorker.worker');
|
||||
} catch (e) {
|
||||
worker = require('./SearchWorker.worker').default;
|
||||
|
|
|
@ -127,6 +127,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
|
|||
new webpack.BannerPlugin(BANNER),
|
||||
ignore(/js-yaml\/dumper\.js$/),
|
||||
ignore(/json-schema-ref-parser\/lib\/dereference\.js/),
|
||||
ignore(/^\.\/SearchWorker\.worker$/),
|
||||
],
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user