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

Allow for tasks with special characters in name #59

Open
jaythomas opened this issue Jun 15, 2017 · 0 comments
Open

Allow for tasks with special characters in name #59

jaythomas opened this issue Jun 15, 2017 · 0 comments

Comments

@jaythomas
Copy link

Thanks for the clever tool!

I'm using extract-text-webpack-plugin to generate a manifest file:

{
  "app.css": "app.bundle.8974f7041fb37318bbde0e39d3c9e2d1.css",
  "app.css.map": "app.bundle.8974f7041fb37318bbde0e39d3c9e2d1.css.map",
  "app.js": "app.bundle.fa373866e4cc4051adb3.js",
  "app.js.map": "app.bundle.fa373866e4cc4051adb3.js.map"
}

to pipe into gulp-html-replace like this:

const manifest = require('./manifest.json')
gulp
  .src('.app/index.html')
  .pipe(gulpHtmlReplace(manifest))
  .pipe(gulp.dest('dist/index.html'))

But it seems it doesn't like the .'s in the filenames because my index.html never changes:

<!-- build:app.css -->
<link rel="stylesheet" href="app.css">
<!-- endbuild -->

<!-- build:app.js -->
<script src="app.js"></script>
<!-- endbuild -->

However, if I manually remove the "." from the manifest filenames and the task names in the html (so that they both read like <!-- build:appcss -->) then it does its job:

<link rel="stylesheet" href="app.bundle.8974f7041fb37318bbde0e39d3c9e2d1.css">
<script src="app.bundle.fa373866e4cc4051adb3.js"></script>

I couldn't see anything in the readme mentioning special characters. Is this a bug?

As a workaround I could always strip special characters out of the generated manifest but this isn't ideal since I don't know what could break the tasks besides just periods.

Thanks for any help.

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