Skip to content

Feature Request: Transpile worker JS files #16

@Kerrick

Description

@Kerrick

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions