angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

why there is no js file after using "ng build --prod‘’ in my dist?

Open ElanMu opened this issue 10 years ago • 7 comments

Please provide us with the following information:

OS?

Windows 7

Versions.

angular-cli: 1.0.0-beta.10 node: 6.5.0 os: win32 x64

Repro steps.

ng new testTodo
ng build -- prod

The log given by the failure.

Built project successfully. Stored in "dist/". File sizes:

  • app.css: 208 B (121 B gzipped)
  • main.css: 38 B (51 B gzipped)
  • main.js: 1.18 MB (249.32 KB gzipped)
  • system-config.js: 2.82 KB (722 B gzipped)
  • es6-shim.js: 131.74 KB (30.4 KB gzipped)
  • Reflect.js: 36.91 KB (5.29 KB gzipped)
  • system.src.js: 159.74 KB (39.05 KB gzipped)
  • zone.js: 55.33 KB (11.98 KB gzipped)

It's builded successfully,but there is no js file in my dis file!

Mention any other details that might be useful.

I add blow in my angular-cli.json file:

"environments": { "source": "config/environment.ts", "dev": "config/environment.ts", "prod": "config/environment.prod.ts" }

but after " ng build --prod", there is only css and html file and the "app/share/index.ts" is not exist in "dist/app/share"?

ElanMu avatar Oct 18 '16 10:10 ElanMu

Duplicate of: https://github.com/angular/angular-cli/issues/1637 https://github.com/angular/angular-cli/issues/1452 https://github.com/angular/angular-cli/issues/1413

You'll want to move to the latest beta.17 w/ webpack and off of the old Broccoli based beta.10 build. Instructions for this migration are here: https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14

Splaktar avatar Oct 18 '16 15:10 Splaktar

Thanks for your help! But there is a new problem ! I follow the "upgrading-from-Beta.10-to-Beta.14" to delete the "system-config.json" file. I need to add the "angular2-cookie" plunk which needs to add angular2-cookie to the map and packages object in the system-config.ts. My console appear an error "No provider for CookieService!"!

In my app.module.ts file: "import { CookieService } from './../angular2-cookie/services/cookies.service';" providers :[ CookieService ]

In my components: "import {CookieService} from 'angular2-cookie/core';"

So,what should I do? Can you help me? @Splaktar

ElanMu avatar Oct 20 '16 02:10 ElanMu

@ElanMu we do not support pre-beta.15 versions anymore unfortunately. Like @Splaktar said, you should upgrade.

Regarding angular2-cookie, I don't know anything about how the library works so I'd advise you to ask at their issue tracker or on Stack Overflow.

filipesilva avatar Oct 23 '16 20:10 filipesilva

Ok! Thanks a lot!

ElanMu avatar Oct 24 '16 01:10 ElanMu

@ElanMu you should follow these instructions: https://github.com/salemdar/angular2-cookie#-usage. The angular2-cookie instructions for angular-cli are all out of date and can be ignored. There is an issue to improve those docs here: https://github.com/salemdar/angular2-cookie/issues/22

Splaktar avatar Oct 24 '16 01:10 Splaktar

OK, I'll look at it, thank you.

ElanMu avatar Oct 24 '16 01:10 ElanMu

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.