Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
STARTER.libraries.yml points to "js/scripts.js" instead of "js/js-src/scripts.js"
Comment | File | Size | Author |
---|---|---|---|
#18 | fixed-watch-js-path.patch | 695 bytes | FiNeX |
Comments
Comment #2
kevinquillen CreditAttribution: kevinquillen commentedThis is because the Gulpfile will minify/compress that file to js/scripts.js when ran.
I don't think it is necessarily a bug.
Comment #3
ahwebd CreditAttribution: ahwebd commentedthis leads us to discover a misplacement of directory js-src in starter subtheme, it should be placed in STARTER directory instead of STARTER /js (alternatively we can make path adjustments in Gulpfile.js)
Comment #4
kevinquillen CreditAttribution: kevinquillen commentedWhat is the issue again here exactly? That the file doesn't exist until you run Gulp?
Comment #5
ahwebd CreditAttribution: ahwebd commentedGulp does not process js, because the path given to gulp.src is './js-src/*.js' but this path does not exist.
Comment #6
kevinquillen CreditAttribution: kevinquillen commentedMy bad. I have pushed a fix to dev.
Comment #7
kevinquillen CreditAttribution: kevinquillen commentedComment #9
FiNeX CreditAttribution: FiNeX as a volunteer commentedHi, probably something went wrong because the bug is not yet fixed, I've tested both -dev and stable release, the path on Gulpfile.js is still wrong.
Thanks.
Comment #10
kevinquillen CreditAttribution: kevinquillen commentedComment #11
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #12
kevinquillen CreditAttribution: kevinquillen at Velir commentedFiNeX, I have reviewed the Gulpfile and it it appears to contain the changes mentioned above.
After running gulp or gulp compress, it should generate a scripts.js file in subtheme/js/scripts.js. I just tried it with 8.x-1.x-dev and a fresh subtheme.
Comment #13
FiNeX CreditAttribution: FiNeX as a volunteer commentedOk, thanks!
Comment #14
kevinquillen CreditAttribution: kevinquillen at Velir commentedJust to clarify, that is the generated, uglified output of js/js-src/*.js. That is what you would edit.
Comment #15
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #16
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #17
FiNeX CreditAttribution: FiNeX as a volunteer commentedHi Kevin.
I've re-checked the 8.x-1.x-dev. The "compress" task is ok. The "watch" task still contains a wrong path.
The current code is:
gulp.watch(['js-src/**/*.js'], ['compress', 'drush:cc']);
It should be:
gulp.watch(['js/js-src/**/*.js'], ['compress', 'drush:cc']);
Thanks :-)
Comment #18
FiNeX CreditAttribution: FiNeX as a volunteer commentedSimple patch to -dev version.
Comment #21
kevinquillen CreditAttribution: kevinquillen at Velir commentedHuh weird, that seeped back into the repo somehow on both versions. I've changed both.
Comment #22
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #23
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #24
kevinquillen CreditAttribution: kevinquillen at Velir commentedFurther discussions on the js folder are happening here:
#2511612: Javascript doesn't have a source folder and gets minified
Comment #25
FiNeX CreditAttribution: FiNeX as a volunteer commentedThanks Kevin!
Comment #26
rovoI had the same issue in neato 7.x-1.2+4-dev
#17 resolved the issue for me.