srowhani / ember-artisans

An abstraction layer around using web-workers in Ember.js
https://srowhani.github.io/ember-artisans
25 stars 3 forks source link

Feature Request: Transpile worker JS files #16

Open Kerrick opened 4 years ago

Kerrick commented 4 years ago

I'd love to be able to transpile the worker JS files with the same plugins & options as set in the application's ember-cli-babel options in ember-cli-build.js. For example, I'd love to be able to use this kind of code in a worker:

export default class ExampleWorker {
  #privateMember = 'hello world';
  greet() {
    return this.#privateMember;
  }
}

That kind of code does work in my application, since I've got my ember-cli-build.js file looking like this in the relevant parts:

  let app = new EmberApp(defaults, {
    babel: {
      plugins: [
        [require.resolve("@babel/plugin-proposal-decorators"), { "legacy": true }],
        [require.resolve("@babel/plugin-proposal-class-properties"), { "loose": true }],
        [require.resolve("@babel/plugin-proposal-private-methods"), { "loose": true }],
      ],
    },
  });

Normally I'd make a PR rather than a feature request, but I don't know enough about Broccoli to make this happen.