Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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: [
[