Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Identifier 'globalVar' has already been declared" when using JS modules #148

Closed
ondrej-merkun opened this issue May 29, 2019 · 1 comment

Comments

@ondrej-merkun
Copy link

ondrej-merkun commented May 29, 2019

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"));
});
@ondrej-merkun
Copy link
Author

Turns out this is natural behavior of files that are concatenated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant