Skip to content

gulp serve command modifying client/app/app.constant.js file #1796

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
siva3378 opened this issue Apr 20, 2016 · 6 comments
Closed

gulp serve command modifying client/app/app.constant.js file #1796

siva3378 opened this issue Apr 20, 2016 · 6 comments

Comments

@siva3378
Copy link

When ever i'm executing gulp serve, it is modifiying app.constant.js file

Item Version
generator-angular-fullstack 1.6.0
Node v5.5.0
npm 3.3.12
Operating System Windows 7
Item Answer
Transpiler Babel
Markup HTML
CSS CSS / LESS / SCSS / Stylus
Router ui-router
Build Tool Gulp
Client Tests Jasmine
DB MongoDB
Auth Y
@siva3378
Copy link
Author

duplicate of #1587

@siva3378
Copy link
Author

I think even-though it is excluded, still this problem exists

gulp.task('lint:scripts:client', () => {
    return gulp.src(_.union(
    paths.client.scripts,
    _.map(paths.client.test, blob => '!' + blob),
    [`!${clientPath}/app/app.constant.js`]
)).pipe(lintClientScripts());
});

@siva3378 siva3378 reopened this Apr 20, 2016
@Awk34
Copy link
Member

Awk34 commented Apr 20, 2016

Is there a reason that you think the app.constant.js file shouldn't be changed when running gulp serve?

@siva3378
Copy link
Author

siva3378 commented Apr 20, 2016

Yes, for some js global objects like d3 & moment, it better to register in constants right. So I will be putting in this app.constant.js file as follows

.constant('d3', d3)
.constant('moment', moment)
// d3 & moment are global objects

@Awk34
Copy link
Member

Awk34 commented Apr 20, 2016

That's not the purpose of that file. Look at the relevant Gulp code https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/app/templates/gulpfile.babel(gulp).js#L610-L623 . It takes all the variables in server/config/environment/shared.js and writes them to a file. Anything in the file will be overwritten when you run the constant task again.

@Awk34 Awk34 closed this as completed Apr 20, 2016
@siva3378
Copy link
Author

ok Thank you Andrew. Its really great work.

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