fix: fix search-indexing for SSR

This commit is contained in:
Roman Hotsiy 2018-03-06 13:12:14 +02:00
parent e94f84283d
commit 1428fb52e0
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 13 additions and 14 deletions

View File

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

View File

@ -66,18 +66,6 @@ export default env => {
module: {
rules: [
{
test: /\.worker\.ts$/,
use: [
{
loader: 'workerize-loader',
options: {
inline: true,
fallback: false,
},
},
],
},
{
test: /\.tsx?$/,
use: [

View File

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