mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 02:23:43 +03:00
fix: fix search-indexing for SSR
This commit is contained in:
parent
e94f84283d
commit
1428fb52e0
|
@ -1,6 +1,17 @@
|
|||
import { IMenuItem } from './MenuStore';
|
||||
import { OperationModel } from './models';
|
||||
import worker from './SearchWorker.worker';
|
||||
|
||||
let worker;
|
||||
|
||||
if (typeof URL !== 'undefined') {
|
||||
try {
|
||||
worker = require('workerize-loader?inline&fallback=false!./SearchWorker.worker').default;
|
||||
} catch (e) {
|
||||
worker = require('./SearchWorker.worker').default;
|
||||
}
|
||||
} else {
|
||||
worker = require('./SearchWorker.worker').default;
|
||||
}
|
||||
|
||||
export class SearchStore {
|
||||
searchWorker = new worker();
|
||||
|
|
|
@ -66,18 +66,6 @@ export default env => {
|
|||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.worker\.ts$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'workerize-loader',
|
||||
options: {
|
||||
inline: true,
|
||||
fallback: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: [
|
||||
|
|
|
@ -8357,7 +8357,7 @@ wordwrap@~1.0.0:
|
|||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
||||
|
||||
workerize-loader@^1.0.1:
|
||||
workerize-loader@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/workerize-loader/-/workerize-loader-1.0.2.tgz#ec87bfd2f97a589907172c5ebbcc5c9abbeb7686"
|
||||
dependencies:
|
||||
|
|
Loading…
Reference in New Issue
Block a user