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

Duplicate JS #7

Closed
indolering opened this issue Nov 2, 2014 · 2 comments
Closed

Duplicate JS #7

indolering opened this issue Nov 2, 2014 · 2 comments

Comments

@indolering
Copy link
Contributor

You appear to be inlining the same scripts:

gulp.task('inlinetest', function(){
  gulp.src('./src/test.html')
    .pipe(inline({
      base: 'src/'
    }))
    .pipe(gulp.dest("./spx/"));
});

test.html

<!DOCTYPE html>
<html>
<head>
  <script src="foo.js"  type='text/javascript'></script>
  <script src="bar.js"  type='text/javascript'></script>
</head>
<body>

<script>
  foo();
  bar();
</script>

</body>
</html>

foo.js

function foo(){
  console.log("foo");
}

bar.js

function bar(){
  console.log("bar");
}

output

<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript">
function foo(){
  console.log("foo");
}
</script>
  <script type="text/javascript">
function foo(){
  console.log("foo");
}
</script>
</head>
<body>

<script>
  foo();
  bar();
</script>

</body>
</html>
@ashaffer
Copy link
Owner

I believe this is fixed now if you update. If you're still having problems let me know and i'll try to fix it.

@tpluscode
Copy link

Hi. I have the same problem in my repository. The output file ld-presenter.html has one of the two scripts duplicated. It seems that it's not always the same one.

@jvdub jvdub mentioned this issue Mar 25, 2015
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

3 participants