Closed ondrej-merkun closed 5 years ago
File1.js code:
export const globalVar = "lol";
File2.js code:
import { globalVar } from "./File1.js"
Gulpfile.js code:
const gulp = require("gulp"); const babel = require("gulp-babel"); const concat = require('gulp-concat'); gulp.task("default", function () { return gulp.src("src/js/*.js") .pipe(concat('scripts.js')) .pipe(babel()) .pipe(gulp.dest("dist/js")); });
Turns out this is natural behavior of files that are concatenated.
File1.js code:
File2.js code:
Gulpfile.js code: