webworker with webpack worked

pull/9/head
aniket-engg 4 years ago
parent 18cbded23b
commit 1154b8ec80
  1. 4
      libs/remix-solidity/src/compiler/compiler-worker.ts
  2. 4
      libs/remix-solidity/src/compiler/compiler.ts
  3. 14
      package.json
  4. 2
      tsconfig.json

@ -1,13 +1,13 @@
'use strict'
import solc from 'solc/wrapper'
import * as solc from 'solc/wrapper'
import { CompilerInput, MessageToWorker } from './types'
let compileJSON: ((input: CompilerInput) => string) | null = (input) => { return '' }
const missingInputs: string[] = []
// 'DedicatedWorkerGlobalScope' object (the Worker global scope) is accessible through the self keyword
// 'dom' and 'webworker' library files can't be included together https://github.com/microsoft/TypeScript/issues/20595
export default (self): void => { // eslint-disable-line @typescript-eslint/explicit-module-boundary-types
export default function (self) { // eslint-disable-line @typescript-eslint/explicit-module-boundary-types
self.addEventListener('message', (e) => {
const data: MessageToWorker = e.data
switch (data.cmd) {

@ -1,7 +1,7 @@
'use strict'
import { update } from 'solc/abi'
import webworkify from 'webworkify'
import * as webworkify from 'webworkify-webpack'
import compilerInput from './compiler-input'
import { EventManager } from '@remix-project/remix-lib'
import { default as txHelper } from './txHelper';
@ -211,7 +211,7 @@ export class Compiler {
*/
loadWorker (url: string): void {
this.state.worker = webworkify(require('./compiler-worker').default)
this.state.worker = webworkify(require.resolve('./compiler-worker.js'))
const jobs: Record<'sources', SourceWithTarget> [] = []
this.state.worker.addEventListener('message', (msg: Record <'data', MessageFromWorker>) => {

@ -228,14 +228,14 @@
"nyc": "^13.3.0",
"onchange": "^3.2.1",
"prettier": "1.19.1",
"remix-analyzer": "0.5.2",
"remix-astwalker": "0.0.24",
"remix-debug": "0.4.4",
"remix-lib": "0.4.29",
"remix-simulator": "0.1.9-beta.5",
"remix-solidity": "0.3.30",
"@remix-project/remix-analyzer": "0.5.2",
"@remix-project/remix-astwalker": "0.0.24",
"@remix-project/remix-debug": "0.4.4",
"@remix-project/remix-lib": "0.4.29",
"@remix-project/remix-simulator": "0.1.9-beta.5",
"@remix-project/remix-solidity": "0.3.30",
"remix-tabs": "1.0.48",
"remix-tests": "0.1.33",
"@remix-project/remix-tests": "0.1.33",
"remixd": "0.1.8-alpha.16",
"request": "^2.83.0",
"rimraf": "^2.6.1",

@ -21,7 +21,7 @@
"@remix-project/remix-debug": ["libs/remix-debug/index.js"],
"@remix-project/remix-lib": ["libs/remix-lib/index.js"],
"@remix-project/remix-simulator": ["libs/remix-simulator/index.js"],
"@remix-project/remix-solidity": ["libs/remix-solidity/src/index.ts"],
"@remix-project/remix-solidity": ["dist/libs/remix-solidity/index.js"],
"@remix-project/remix-tests": ["libs/remix-tests/src/index.ts"],
"@remix-project/remix-url-resolver": ["libs/remix-url-resolver/src/index.ts"]
}

Loading…
Cancel
Save