chore: remove worker from main bundle for browser/standalone build

This commit is contained in:
Roman Hotsiy 2018-03-26 18:17:01 +03:00
parent 33eaf77dc5
commit deffdc548e
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
4 changed files with 5 additions and 2 deletions

View File

@ -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']),
],
});

View File

@ -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) {

View File

@ -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;

View File

@ -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$/),
],
});