How to use the @embroider/core.babelFilter function in @embroider/core

To help you get started, we’ve selected a few @embroider/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ef4 / ember-auto-import / packages / ember-auto-import / ts / webpack.ts View on Github external
private babelRule(): webpack.Rule {
    let shouldTranspile = babelFilter(this.skipBabel);
    let stagingDir = this.stagingDir;
    return {
      test(filename: string) {
        // We don't apply babel to our own stagingDir (it contains only our own
        // entrypoints that we wrote, and it can use `import()`, which we want
        // to leave directly for webpack).
        //
        // And we otherwise defer to the `skipBabel` setting as implemented by
        // `@embroider/core`.
        return dirname(filename) !== stagingDir && shouldTranspile(filename);
      },
      use: {
        loader: 'babel-loader-8',
        options: {
          presets: [
            [