loopback-example-offline-sync icon indicating copy to clipboard operation
loopback-example-offline-sync copied to clipboard

grunt serve:dist produce empty uglified js files

Open pdarscht opened this issue 11 years ago • 7 comments

Hi there, I succeeded with grunt serve, etc. when using grunt serve: dist, the process seems to end successfully, I start the app normally at localhost:3000, as well as the REST explorer, BUT the index.html page looks have no links (Home, Login, Register have no link). Having a look at the files, I found that the generated scripts.d41d8cd9.js and vendor.d41d8cd9.js are empty. As I am new to many of these topics, I would appreciate some hints.

here is the console log of the grunt serve:dist command:

C:\...\loopback-example-full-stack-master>grunt serve:
dist
Running "serve:dist" (serve) task

Running "clean:dist" (clean) task
Cleaning .tmp...OK

Running "build-lbclient" task

Running "build-config" task

Running "wiredep:app" (wiredep) task

Running "useminPrepare:html" (useminPrepare) task
Configuration changed for concat, uglify, cssmin

Running "concurrent:dist" (concurrent) task

Running "copy:styles" (copy) task
Copied 1 files

Done, without errors.

Running "imagemin:dist" (imagemin) task
Minified 0 images (saved 0 B)

Done, without errors.

Running "svgmin:dist" (svgmin) task
Total saved: 0 B

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/main.css created.

Running "concat:generated" (concat) task
File .tmp\concat\scripts\vendor.js created.
File .tmp\concat\scripts\scripts.js created.

Running "ngAnnotate:dist" (ngAnnotate) task
>> 2 files successfully generated.

Running "copy:dist" (copy) task
Copied 9 files

Running "cdnify:dist" (cdnify) task
Going through client/dist/index.html to update script refs
? bower_components/angular/angular.js changed to //ajax.googleapis.com/ajax/libs
/angularjs/1.2.26/angular.min.js
? bower_components/angular-route/angular-route.js changed to //ajax.googleapis.c
om/ajax/libs/angularjs/1.2.26/angular-route.min.js

Running "cssmin:generated" (cssmin) task
>> Destination not written because minified CSS was empty.
File client\dist\styles\main.css created: 9.8 kB → 7.54 kB

Running "uglify:generated" (uglify) task

Running "filerev:dist" (filerev) task
? client/dist/scripts/scripts.js changed to scripts.d41d8cd9.js
? client/dist/scripts/vendor.js changed to vendor.d41d8cd9.js
? client/dist/styles/main.css changed to main.291524af.css

Running "usemin:html" (usemin) task
Replaced 7 references to assets

Running "usemin:css" (usemin) task
Replaced 1 reference to assets

Running "htmlmin:dist" (htmlmin) task
Minified client/dist/index.html 1.43 kB → 1.28 kB
Minified client/dist/views/changes.html 1.94 kB → 1.6 kB
Minified client/dist/views/login.html 43 B → 41 B
Minified client/dist/views/register.html 46 B → 44 B
Minified client/dist/views/todos.html 4.28 kB → 3.38 kB
Minified client/dist/views/user.html 42 B → 40 B
Minified client/dist/views/welcome.html 90 B → 87 B

Running "run:dist:keepalive" (run) task
loopback deprecated The model Todo is tracking changes, which requries a string
id with GUID/UUID default value. events.js:180:16
Browse your REST API at http://localhost:3000/explorer
Web server listening at: http://localhost:3000/
express deprecated res.sendfile: Use res.sendFile instead server\boot\angular-ro
utes.js:7:13

pdarscht avatar Mar 20 '15 13:03 pdarscht

I am having the same issue, using the webapp generator. My main.js file is empty after running the grunt serve:dist command. This is my console output:

ning "serve:dist" (serve) task

Running "clean:dist" (clean) task
>> 8 paths cleaned.

Running "wiredep:app" (wiredep) task

Running "wiredep:sass" (wiredep) task

Running "useminPrepare:html" (useminPrepare) task
Configuration changed for concat, uglify, cssmin

Running "concurrent:dist" (concurrent) task

    Running "copy:styles" (copy) task


    Done, without errors.


    Execution Time (2015-04-10 22:19:26 UTC)
    loading tasks  2.5s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
    Total 2.5s

    Running "imagemin:dist" (imagemin) task
    Minified 0 images (saved 0 B)

    Done, without errors.


    Execution Time (2015-04-10 22:19:26 UTC)
    loading tasks  2.5s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
    Total 2.5s

    Running "svgmin:dist" (svgmin) task
    Total saved: 0 B

    Done, without errors.


    Execution Time (2015-04-10 22:19:26 UTC)
    loading tasks   2.4s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 80%
    svgmin:dist    586ms  ▇▇▇▇▇▇▇▇▇▇ 20%
    Total 3s

    Running "sass:dist" (sass) task
    File .tmp/styles/main.css created.
    File .tmp/styles/main.css.map created.

    Running "sass:server" (sass) task
    File .tmp/styles/main.css created.
    File .tmp/styles/main.css.map created.

    Done, without errors.


    Execution Time (2015-04-10 22:19:26 UTC)
    loading tasks   2.5s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 78%
    sass:dist      534ms  ▇▇▇▇▇▇▇▇▇ 17%
    sass:server    144ms  ▇▇▇ 5%
    Total 3.1s

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/main.css created.

Running "concat:generated" (concat) task
File .tmp/concat/styles/vendor.css created.
File .tmp/concat/styles/main.css created.
File .tmp/concat/scripts/vendor.js created.
File .tmp/concat/scripts/main.js created.

Running "cssmin:generated" (cssmin) task
>> Destination not written because minified CSS was empty.
File dist/styles/main.css created: 135.57 kB → 108.36 kB

Running "uglify:generated" (uglify) task

Running "copy:dist" (copy) task
Copied 8 files

Running "rev:dist" (rev) task
dist/scripts/main.js >> d41d8cd9.main.js
dist/scripts/vendor.js >> 94ec45c8.vendor.js
dist/styles/main.css >> 9828601d.main.css
dist/favicon.ico >> 6df2b309.favicon.ico

Running "usemin:html" (usemin) task
Replaced 1 reference to assets

Running "usemin:css" (usemin) task
Replaced 1 reference to assets

Running "htmlmin:dist" (htmlmin) task
Minified dist/index.html 1.94 kB → 1.67 kB

Running "connect:dist:keepalive" (connect) task
Waiting forever...
Started connect web server on http://localhost:9000

The file .tmp/concat/scripts/main.js is also empty. Thank you for your help!

xanarin avatar Apr 10 '15 22:04 xanarin

@superkhau could you please take a look and check if you can reproduce this issue?

bajtos avatar Apr 21 '15 16:04 bajtos

@bajtos Reproduced. Those files are empty for me too.

superkhau avatar Apr 21 '15 17:04 superkhau

Yay! I fixed it by adding the missing cwd paths to the usemin block for the scripts.js :)

<!-- build:js({.,.tmp,reapp,client/reapp,client}) scripts/scripts.js -->

Morriz avatar May 29 '15 01:05 Morriz

A patch in progress that should fix the issue: #64

bajtos avatar May 29 '15 06:05 bajtos

@Morriz What about vendor.js?

Renaud009 avatar Oct 23 '15 14:10 Renaud009

@chandadharap removing "slipped" label and moving the story to "community" column.

bajtos avatar Nov 30 '15 10:11 bajtos