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

Setting a custom filename for the outputted file via options? #46

Open
nick13jaremek opened this issue May 17, 2017 · 2 comments
Open

Comments

@nick13jaremek
Copy link

Hi there,

I am currently using the gulp-ng-constant module as follows:

ngConstants = require('gulp-ng-constant');

gulp.task('create-version-file', [], function () {
    var constants = { version: '1.0.0' };
    return ngConstant({
        constants: constants,
        wrap: false,
        deps: [],
        stream: true,
        name: 'myapp.version'
      })
        .pipe(gulp.dest('dist'))
});

However, doing so, creates an Angular constants file named ngConstants.js. Forcing a filename in gulp.dest by specifying a full path, as in gulp.dest('dist/version.js') creates a directory called version.js (which contains the generated ngConstants.js file) inside the dist directory.

No option seems to exist to specify the filename of the generated constants file. Is it so, or am I missing something in the docs?

Thanks in advance!

@guzart
Copy link
Owner

guzart commented May 20, 2017

Are you using v1.1? In v1, the name property only applies to the angular module name.

The readme in the master branch is for the preview version of v2.0.0-2, I apologize for the confusion.

@johnnyflinn
Copy link

@nick13jaremek I ended up using gulp-rename to accomplish this. Just pipe it before the gulp.dest pipe.

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