Skip to content
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

ng build -prod fails #1047

Closed
steveblue opened this issue Jun 9, 2016 · 6 comments
Closed

ng build -prod fails #1047

steveblue opened this issue Jun 9, 2016 · 6 comments

Comments

@steveblue
Copy link

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OS X El Capitan 10.11.6 Beta (15G7b)

  1. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    And paste the result here.

angular-cli: 1.0.0-beta.5
node: 5.5.0
os: darwin x64

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

I have added a few libraries to angular-cli-build.js and configured a broccoli tree to output global CSS but thats it. Even without the css tree, the problem exists. The TS doesn't get compiled for prod and my public folder doesn't get deployed. Everything works without the -prod flag. I also followed some advice seen in other posts here to no avail, nothing seems to make it work.

 let appTree = new Angular2App(defaults, {
      sourceDir: sourceDir,
      sassCompiler: {
        includePaths: [
          'src/style'
        ]
      },
      vendorNpmFiles: [
        'systemjs/dist/system-polyfills.js',
        'systemjs/dist/system.src.js',
        'es6-shim/es6-shim.js',
        'zone.js/dist/**/*.+(js|js.map)',
        'reflect-metadata/**/*.+(js|js.map)',
        'rxjs/**/*.+(js|js.map)',
        '@angular/**/*.+(js|js.map)',
        'd3/**/*.+(js|js.map)',
        'three/**/*.+(js|js.map)',
        'firebase/lib/*.+(js|ts|js.map)'
      ]
    });
  1. The log given by the failure. Normally this include a stack trace and some
    more information.

$ ng build -prod
⠼ Building"{{content-for}}" has been deprecated and will be removed before RC.
Built project successfully. Stored in "dist/".
File sizes:

  • app.component.css: 0 B
  • audio-player.component.css: 51 B (53 B gzipped)
  • button.component.css: 1.43 KB (575 B gzipped)
  • nav.component.css: 574 B (326 B gzipped)
  • slider.component.css: 2.01 KB (569 B gzipped)
  • toggle.component.css: 1.4 KB (544 B gzipped)
  • track-item.component.css: 517 B (274 B gzipped)
  • track-list.component.css: 241 B (169 B gzipped)
  • waveform.component.css: 165 B (143 B gzipped)
  • index.js: 69.26 KB (13.62 KB gzipped)
  • about.component.css: 111 B (109 B gzipped)
  • default.component.css: 180 B (151 B gzipped)
  • music-player.component.css: 60 B (76 B gzipped)
  • particle.component.css: 330 B (158 B gzipped)
  • remote-ui-demo.component.css: 773 B (330 B gzipped)
  • rtc-client.component.css: 216 B (172 B gzipped)
  • synth.component.css: 801 B (338 B gzipped)
  • ui-test.component.css: 1 KB (411 B gzipped)
  • main.js: 760.83 KB (158.95 KB gzipped)
  • _app.css: 2.13 KB (775 B gzipped)
  • style.css: 2.9 KB (1021 B gzipped)
  • _colors.css: 0 B
  • _fonts.css: 622 B (210 B gzipped)
  • _mixins.css: 164 B (148 B gzipped)
  • _normalize.css: 8.74 KB (2.96 KB gzipped)
  • _sprites.css: 0 B
  • _variables.css: 0 B
  • system-config.js: 1.82 KB (577 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.57 KB (38.99 KB gzipped)
  • zone.js: 52.72 KB (11.37 KB gzipped)
  1. Mention any other details that might be useful.

The repo is here if you want to pull it down and inspect yourself.

https://github.com/steveblue/ng2-examples-cli

@steveblue
Copy link
Author

ng serve -prod works except JS stored in the public folder doesn't deploy and even some files declared in vendorNpmFiles, firebase for example is 404.

@MarkPieszak
Copy link
Member

Potentially linked to #1052

@hmrc87
Copy link

hmrc87 commented Jun 13, 2016

Maybe my post here will help you:

#718 (comment)

@filipesilva
Copy link
Contributor

I believe the public folder issue is #540, but I'm not sure what's happening with the vendorNpmFiles ones. I'll have a look.

@filipesilva
Copy link
Contributor

I've ran your app, and the vendor files that fail loading are because they are being included as script tags. You'll need to configure those as global packages in SystemJS, more info here: #1015

Regarding js not being copied over from public dir, I'll address that on #540.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants