Skip to content

[email protected] will miss file when building, while [email protected] OK #2146

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

Closed
jacinchan opened this issue Aug 12, 2016 · 4 comments
Closed

Comments

@jacinchan
Copy link

Item Version
generator-angular-fullstack 3.7.6
Node 5.10.1
npm x.x.x
Operating System OS X 10 / Windows 10 / Ubuntu 15.10 / etc
etc etc
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ui-router
Client Tests Mocha
DB MongoDB
Auth N
etc etc

when I use gulp build, i found app.js did not uglity or rev
problem is
[email protected] will miss some files.
if i reset to [email protected], it's OK
see the gulp file here

in gulp.task('build:client')

return gulp.src(paths.client.mainView)
.pipe(plugins.useref())
.pipe(appFilter)
.pipe(plugins.addSrc.append('.tmp/templates.js'))
.pipe(plugins.concat('app/app.js'))
.pipe(appFilter.restore) ------------- // app/app.js is included
.pipe(jsFilter) ------------- // app/app.js is excluded!
.pipe(plugins.ngAnnotate())
.pipe(plugins.uglify())
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(plugins.cleanCss({
processImportFrom: ['!fonts.googleapis.com']
}))
.pipe(cssFilter.restore)
.pipe(htmlBlock) //the same problem here
.pipe(plugins.rev())
.pipe(htmlBlock.restore)
.pipe(plugins.revReplace({manifest}))
.pipe(gulp.dest(${paths.dist}/${clientPath}));

@Awk34
Copy link
Member

Awk34 commented Aug 12, 2016

Could you elaborate more? Why would gulp-filter 4 break this while it works with 3?

@jacinchan
Copy link
Author

jacinchan commented Aug 12, 2016

[email protected] change the way of calling multimatch
4.0.0 -- > multimatch(path.relative(file.cwd, file.path), pattern, options)
test

console.log(minimatch(".tmp/app/app.js", "**/*.js")); //false
console.log(minimatch(".tmp/app/app.js", "**/*.js",{dot:true})); //true

that the problem.
so if we use [email protected]
our filter option must add {dot:true}
that's

var appFilter = plugins.filter('**/app.js', {restore: true, dot:true});
var jsFilter = plugins.filter('**/*.js', {restore: true, dot:true});
var cssFilter = plugins.filter('**/*.css', {restore: true, dot:true});
var htmlBlock = plugins.filter(['**/*.!(html)'], {restore: true, dot:true});

@Awk34
Copy link
Member

Awk34 commented Aug 12, 2016

Would you be comfortable sending a pull request to the 3.x.x branch?

jacinchan added a commit to jacinchan/generator-angular-fullstack that referenced this issue Aug 13, 2016
when gulp build, [email protected] will miss file path start with dot like ".tmp/app/app.js", that cause some files not uglify or rev. add option "dot:true" resolve the problem

angular-fullstack#2146 angular-fullstack#2146
@jacinchan
Copy link
Author

well, it's my first pull request... i don't know how to use actually.

Awk34 pushed a commit that referenced this issue Sep 13, 2016
when gulp build, [email protected] will miss file path start with dot like ".tmp/app/app.js", that cause some files not uglify or rev. add option "dot:true" resolve the problem

fixes #2146, closes #2151
@Awk34 Awk34 closed this as completed Sep 13, 2016
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

2 participants