G
G
goodw842016-01-10 17:34:41
PHP
goodw84, 2016-01-10 17:34:41

Script paths using bower and grunt?

I decided to use Bower and Grunt in a big project (PHP, PostgreSQL, etc).
1. I have a production server where I deliver a fresh build.
2. Commise bower.json and gruntfile.js to the repository
3. In production, bower updates the necessary libraries, Grunt packs everything and glues it into one file, for example: script.js
Questions:
1. If I locally have a separate path to each JS- file, for example:

/libs/jquery.min.js
/js/common.js
/js/jquery-ui.js

etc.
How, after delivery to production, to replace these paths with a single one:
build/script.js?
2. If you immediately register the path to build/script.js locally?
3. Files with what paths should be stored correctly in the repository?
/libs/jquery.min.js
/js/common.js
/js/jquery-ui.js

or
build/script.js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-01-10
@goodw84

1. stackoverflow.com/questions/12401998/have-grunt-ge...
2. Why not use build/script.js locally too? You can also disable minimization or even use Javascript Source Maps . IMHO, the best solution.
3. Usually, only sources are stored in the repository, and they are already assembled on the server. jquery and other third party libraries shouldn't be in your repository either.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question