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

Output html directory stripped #194

Open
thany opened this issue Jul 23, 2017 · 0 comments
Open

Output html directory stripped #194

thany opened this issue Jul 23, 2017 · 0 comments

Comments

@thany
Copy link

thany commented Jul 23, 2017

This is my structure, as far as this issue is concerned:

- gulpfile.js
- includes
- - php
- - - bottom.php
- - js
- - - default.js
- node_modules
- - blissfuljs
- - - bliss.js

And my code block (in bottom.php):

<!-- build:mainjs includes/js/app.js -->
<script src="node_modules/blissfuljs/bliss.js"></script>
<script src="includes/js/default.js"></script>
<!-- endbuild -->

And my gulp task:

gulp.task("js:dist", [ "clean:dist" ], function() {
  return gulp.src( "includes/php/bottom.php")
    .pipe(usemin({
      path: ".",
      mainjs: [ sourcemaps.init(), "concat", sourcemaps.write(".") ],
    }))
    .pipe(gulp.dest("dist"));
});

What actually happens:

- dist
- - bottom.php
- - includes
- - - js
- - - - app.js

What should happen:

- dist
- - includes
- - - php
- - - - bottom.php
- - - js
- - - - app.js

Basically, in the output stream, the source file includes/php/bottom.php is stripped to just bottom.php. This causes it to be written to the root of the directory passed to gulp.dest(). I couldn't find any combination of options to force it back into the correct directory.

  • Replacing path: "." with assetsDir: "." changes absolutely nothing.
  • Adding assetsDir: "." causes usemin to search 2 directories up for scripts???
  • Adding outputRelativePath: "includes/php" causes the destination script file to become includes\php\includes\js\app.js and changes nothing for bottom.php.

So, I don't know how tell usemin what I want. It really does seem like a bug to me, the fact that the output html filename is altered, and cannot be corrected in any way.

  • Node 8.2.1
  • NPM 5.3.0
  • Gulp 3.9.1
  • Usemin 0.3.28
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