Giter Club home page Giter Club logo

Comments (32)

filipesilva avatar filipesilva commented on April 28, 2024 19

That bit is the next one I'm working on, to be able to bundle stuff.

from angular-cli.

Avien avatar Avien commented on April 28, 2024 10

Currently ng build --prod still generates source maps
How can I build without suorce maps?
Thanks

from angular-cli.

cironunes avatar cironunes commented on April 28, 2024 6

Still missing:

  • add a CNAME?
  • enableProdMode()
  • inlining HTML and CSS resources
  • bundling
  • taking lazy routes into account
  • only use service worker in prod builds #230

from angular-cli.

JohannesHoppe avatar JohannesHoppe commented on April 28, 2024 3

You are talking about adding a CNAME file, which implies that Github Pages is a "first citizen". If you directly support gh-pages, than you also want to copy dist/index.html to dist/404.html. This will enable browser-reloads together with the PathLocationStrategy.

from angular-cli.

SonicGD avatar SonicGD commented on April 28, 2024 2

No, i don't say it fails, i say it's not 'production'. Production build should contain .min lib files, no ts or sourcemaps and etc

from angular-cli.

Misiu avatar Misiu commented on April 28, 2024 2

@neilhem is there an option to skip sourcemaps generation when building using ng build -prod?

from angular-cli.

mashhoodr avatar mashhoodr commented on April 28, 2024 1

hello @filipesilva do we have an approximate timeline for this? I have a project that I will need to deploy to production soon, is there anything you recommend we should use until this is completed?

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024 1

@mashhoodr you can already do production builds, the thing that is missing is more than 2 environments.

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024 1

I think this issue is obsolete by now. All of the features mentioned so far have been addressed, with the possible exception of having service workers in all prod builds. That warrants discussion though so probably should be another issue.

from angular-cli.

Perezmarc avatar Perezmarc commented on April 28, 2024 1

Hey @Misiu, I'm using ng build --prod --aot --no-sourcemap --no-vendor-chunk for my production build.

Still, I get too many files that I believe are unnecessary (but maybe they're not). Would be nice to have all the production deployment options such as: How to deploy gzipped version, how to deploy not gzipped version, with sourcemaps, without sourcemaps...

This are all the files I get when I execute that command. Would appreciate a way to tidy up the production build, maybe include folders to separate files, such as 'js' & 'css'. I also would like to know if I can upload to my cloudfront the .gz without uploading the .js

captura de pantalla 2016-12-21 a les 10 34 17

my angular-cli.json

{
"project": {
"version": "1.0.0-beta.22-1",
"name": "webapp-21b"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"download",
".well-known",
"robots.txt",
"sitemap.xml"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.css",
"./css/main.scss",
"./css/buttons.scss",
"./css/forms.scss",
"./css/navbar.scss",
"./css/nouislider.scss",
"./css/mixins.scss",
"./css/spinner.scss",
"./css/utils.scss",
"./css/vars.scss"
],
"scripts": [
"./assets/js/noUiSlider.9.0.0/nouislider.min.js",
"./assets/js/wNumb.js"
],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [
],
"packages": [
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}

from angular-cli.

jimthedev avatar jimthedev commented on April 28, 2024

Are you getting a specific error? I was able to run this it generates to dist/

Make sure you've got node > 4.1.0.

from angular-cli.

IgorMinar avatar IgorMinar commented on April 28, 2024

Prod builds (or any custom environment builds) are currently not supported. It's one of the many things that need to happen in order to make this project production ready.

from angular-cli.

sivaah avatar sivaah commented on April 28, 2024

Looks like the /dist directory contains the exact copy of src directory including typescript files. I think the typescript files are not required in /dist. The /dist/vendor directory is clean, which has only the javascript files.

from angular-cli.

cironunes avatar cironunes commented on April 28, 2024

In order to do the production build we can take the current build and:

  • remove livereload references in the index.html
  • stop copying the ts files
  • stop copying the tsconfig.json file
  • add a CNAME?
  • enableProdMode()
  • assure that pre-compiled style (LESS/SASS) files are not copied to the dist directory (tks @Brocco )

What else?

from angular-cli.

Brocco avatar Brocco commented on April 28, 2024

Assure that pre-compiled style (LESS/SASS) files are not copied to the dist directory

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024

Config files perhaps, with API addresses and 3rd party services tokens.

from angular-cli.

alexpaluzzi avatar alexpaluzzi commented on April 28, 2024

I think this list looks good @cironunes. Will we also be minifying/mangling?

Really, this production flow is the only thing missing for me to start using this hard right now.

from angular-cli.

hansl avatar hansl commented on April 28, 2024

Picked this as the official production build issue to follow.

from angular-cli.

hansl avatar hansl commented on April 28, 2024

As discussed offline, Filipe will take over for the next few steps, since you don't have as much time :) Good work Ciro!

Added 2 points to your todo list above.

from angular-cli.

alexpaluzzi avatar alexpaluzzi commented on April 28, 2024

So we are bundling now? That would be the best news I've heard all week.

from angular-cli.

cironunes avatar cironunes commented on April 28, 2024

I'd love to continue working on that, but I just don't have the time at the moment :(
I'm glad that Filipe is taking care of it. 😄

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024

@cironunes I added another item to the list:

  • only use service worker in prod builds #230

from angular-cli.

alexpaluzzi avatar alexpaluzzi commented on April 28, 2024

I know still WIP here, but am I missing a flag for using the production vendor libs or is it just unfinished? I can only get angular2.dev.js for instance. That ~1 second bootstrapping time is maddening. Cheers!

from angular-cli.

cdarken avatar cdarken commented on April 28, 2024

Is there any way to add a custom environment by creating a file named for instance config/environment.stage.ts and then execute ng build --environment=stage ? It looks like it's defaulting to dev now.

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024

@cdarken no, it is not currently possible to have more environments other than dev and prod. It's one of my next action items though.

I should mention though (since I haven't yet updated the readme), all builds using -prod use bundling and tree shaking at the moment.

from angular-cli.

cdarken avatar cdarken commented on April 28, 2024

Thanks, I will wait patiently then.

from angular-cli.

marcalj avatar marcalj commented on April 28, 2024

What about Service Workers?
Also images are minifyed and filerevved? (for permanent caching)

Thanks guys!!!

from angular-cli.

filipesilva avatar filipesilva commented on April 28, 2024

Currently service workers are only enabled for mobile projects, but we're looking at having them in all prod builds.

Images are not processed at the moment either.

from angular-cli.

pardipbhatti8791 avatar pardipbhatti8791 commented on April 28, 2024

can anyone tell plz how to run angular cli production mode forever. i want to deploy production build on live server. But i am not getting it.

from angular-cli.

neilhem avatar neilhem commented on April 28, 2024

Run ng build -prod

from angular-cli.

Mahi8686 avatar Mahi8686 commented on April 28, 2024

Can anybody explain,
how to run forever with angular-cli?
What changes i need to do in my files?

Thanks :)

from angular-cli.

angular-automatic-lock-bot avatar angular-automatic-lock-bot commented on April 28, 2024

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.

from angular-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.