<p dir="auto">This:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@decorator
class Classy{}"><pre class="notranslate"><code class="notranslate">@decorator
class Classy{}
</code></pre></div>
<p dir="auto">Transpiles into:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(&quot;Cannot call a class as a function&quot;); } }

var Classy = function Classy() {
  _classCallCheck(this, Classy);
};"><pre class="notranslate"><code class="notranslate">"use strict";

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Classy = function Classy() {
  _classCallCheck(this, Classy);
};
</code></pre></div>
<p dir="auto">Using <code class="notranslate">.babelrc</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [&quot;es2015&quot;],
  &quot;plugins&quot;: [&quot;transform-decorators&quot;]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": ["es2015"],
  "plugins": ["transform-decorators"]
}
</code></pre></div>
<p dir="auto">I have two files<br>
first <code class="notranslate">app-size.srv.js</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export class AppSizeService {
  constructor() {
  }
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">AppSizeService</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">second <code class="notranslate">app-size.dir.js</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { AppSizeService } from 'app-size.srv';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">AppSizeService</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'app-size.srv'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">if i use <code class="notranslate">babel</code> after <code class="notranslate">concat</code> in my gulpfile</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="gulp.task('scripts', () =&gt; {  /* Scripts */
  return gulp.src(paths.getScripts())
    .pipe(plumber())
    .pipe(concat('app.build.js'))
    .pipe(babel())
    .pipe(gulp.dest(paths.build))
    .pipe(uglify())
    .pipe(rename({suffix: '.min'}))
    .pipe(gulp.dest(paths.build));
});"><pre class="notranslate"><span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'scripts'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>  <span class="pl-c">/* Scripts */</span>
  <span class="pl-k">return</span> <span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">src</span><span class="pl-kos">(</span><span class="pl-s1">paths</span><span class="pl-kos">.</span><span class="pl-en">getScripts</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-en">plumber</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s">'app.build.js'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-en">babel</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">dest</span><span class="pl-kos">(</span><span class="pl-s1">paths</span><span class="pl-kos">.</span><span class="pl-c1">build</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-en">uglify</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-en">rename</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">suffix</span>: <span class="pl-s">'.min'</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
    <span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">dest</span><span class="pl-kos">(</span><span class="pl-s1">paths</span><span class="pl-kos">.</span><span class="pl-c1">build</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">then i get error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Plumber found unhandled error:
 TypeError in plugin 'gulp-babel'
Message:
    D:/personal/alexander/projects/rt/client/src/app.build.js: Line 1: Duplicate declaration &quot;AppSizeService&quot;
&gt; 1 | import { AppSizeService } from 'app-size.srv';"><pre class="notranslate"><code class="notranslate">Plumber found unhandled error:
 TypeError in plugin 'gulp-babel'
Message:
    D:/personal/alexander/projects/rt/client/src/app.build.js: Line 1: Duplicate declaration "AppSizeService"
&gt; 1 | import { AppSizeService } from 'app-size.srv';
</code></pre></div>
<p dir="auto">If i use <code class="notranslate">babel</code> before <code class="notranslate">concat</code> in my gulpfile then in the <code class="notranslate">app.build.js</code> file I have much duplicate code</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(&quot;Cannot call a class as a function&quot;); } };

var AppSizeService = require(&quot;app-size.srv&quot;).AppSizeService;
&quot;use strict&quot;;

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(&quot;Cannot call a class as a function&quot;); } };

Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});

var AppSizeService = exports.AppSizeService = function AppSizeService() {
  _classCallCheck(this, AppSizeService);
};"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-en">_classCallCheck</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">instance</span><span class="pl-kos">,</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-kos">(</span><span class="pl-s1">instance</span> <span class="pl-k">instanceof</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Cannot call a class as a function"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">AppSizeService</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"app-size.srv"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">AppSizeService</span><span class="pl-kos">;</span>
<span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-en">_classCallCheck</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">instance</span><span class="pl-kos">,</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-kos">(</span><span class="pl-s1">instance</span> <span class="pl-k">instanceof</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Cannot call a class as a function"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s">"__esModule"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">value</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">AppSizeService</span> <span class="pl-c1">=</span> <span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-en">AppSizeService</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-v">AppSizeService</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">AppSizeService</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">duplicate <code class="notranslate">use strict</code><br>
duplicate declaration of <code class="notranslate">_classCallCheck</code> and <code class="notranslate">AppSizeService</code> too</p>
<p dir="auto">babel version: 4.7.16<br>
gulp version: 3.8.11<br>
gulp-babel version: 4.0.0</p>
<p dir="auto">Maybe I do anything wrong?</p>