This package has been deprecated

Author message:

I'm not maintaining this anymore as i do not find a usecase for it myself at the moment. I/We at work switched to worker-loader and @actorize/core to make the live a little easier

spaceworker-loader

1.0.1 • Public • Published

Spaceworker.js Webpack-loader

This is the Webpack loader for my simple libary to make it easier to use WebWorker called Spaceworker.js

Install

npm install --save-dev spaceworker-loader
OR
yarn add --dev spaceworker-loader

Usage

// app.js
const worker = require("./iss.worker.js")

worker.run("sayHelloWorld", "hello", "world")
    .then(res => {
        console.log(res)
    })
// iss.worker.js
class ISS {
    sayHelloWorld(hello, world) {
        return hello + " " + world + " :)"
    }
}

SpaceWorker.provide(ISS, self)
// webpack.config.js
const path = require('path')
const config = {
    entry: "./app.js",
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: "bundle.js"
    },
    module: {
        rules: [
            { test: /\.worker\.js$/, use: { loader: 'spaceworker-loader' } }
        ]
    }
}

module.exports = config

Dependents (0)

Package Sidebar

Install

npm i spaceworker-loader

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • datsteves