René's URL Explorer Experiment


Title: Rebuild speed and style workflows (feedback) · Issue #2956 · angular/angular-cli · GitHub

Open Graph Title: Rebuild speed and style workflows (feedback) · Issue #2956 · angular/angular-cli

X Title: Rebuild speed and style workflows (feedback) · Issue #2956 · angular/angular-cli

Description: I just finished rewriting my old gulp build tasks to work with CLI. Results are... interesting :) #1980 CLI c:\project>ng s ** NG Live Development Server is running on http://localhost:4200. ** 17976ms building modules ... Time: 26259ms ...

Open Graph Description: I just finished rewriting my old gulp build tasks to work with CLI. Results are... interesting :) #1980 CLI c:\project>ng s ** NG Live Development Server is running on http://localhost:4200. ** 179...

X Description: I just finished rewriting my old gulp build tasks to work with CLI. Results are... interesting :) #1980 CLI c:\project>ng s ** NG Live Development Server is running on http://localhost:4200. ** ...

Opengraph URL: https://github.com/angular/angular-cli/issues/2956

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rebuild speed and style workflows (feedback)","articleBody":"I just finished rewriting my old gulp build tasks to work with CLI. Results are... interesting :) #1980 \r\n\r\n### CLI\r\n\r\n```\r\nc:\\project>ng s\r\n** NG Live Development Server is running on http://localhost:4200. **\r\n17976ms building modules\r\n...\r\nTime: 26259ms\r\n...\r\nwebpack: bundle is now VALID.\r\n\r\nwebpack: bundle is now INVALID.\r\nTime: 10887ms\r\n\r\nwebpack: bundle is now INVALID.\r\nTime: 6893ms\r\n\r\nwebpack: bundle is now INVALID.\r\nTime: 5964ms\r\n\r\nwebpack: bundle is now INVALID.\r\nTime: 9595ms\r\n```\r\n\r\n### Gulp\r\n\r\n```\r\nc:\\project>gulp\r\n[00:47:08] Requiring external module ts-node/register\r\n[00:47:15] Starting 'watch'...\r\n[brSync] Watching files...\r\n[brSync] Access URLs:\r\n       Local: http://localhost:3000\r\n[00:47:18] Finished 'serve' after 2.14 s\r\n\r\n[00:48:42] Starting 'ts'...\r\n[00:48:43] all files 16.27 kB\r\n[00:48:43] Finished 'ts' after 194 ms\r\n\r\n[00:49:33] Starting 'ts'...\r\n[00:49:33] Starting 'styl'...\r\n[00:49:33] Finished 'styl' after 171 ms\r\n[00:49:33] Finished 'ts' after 200 ms\r\n\r\n[00:50:17] Starting 'ts'...\r\n[00:50:17] Finished 'ts' after 57 ms\r\n\r\n[00:51:52] Starting 'ts'...\r\n[00:51:52] Starting 'styl'...\r\n[00:51:52] Finished 'styl' after 274 ms\r\n[00:51:52] all files 15.83 kB\r\n[00:51:52] Finished 'ts' after 308 ms\r\n```\r\n![1](https://cloud.githubusercontent.com/assets/4272818/19841565/fef07b6e-9f0d-11e6-953e-142aefea1f85.PNG)\r\n![2](https://cloud.githubusercontent.com/assets/4272818/19841566/fef089a6-9f0d-11e6-811f-3bebffc0fd48.PNG)\r\n\r\nWebpack is,, of course, much better at optimizing assets, while gulp can be optimized for really fast incremental builds. At this time I didn't do anything with vendor files, I'm just serving them with BrowserSync directly from `node_modules` - that's why there are so many requests and why load times are high. I also didn't bother with code splitting, AoT and other stuff Webpack and CLI already do - I just want fast dev builds; I'm definitely gonna use CLI for that stuff.\r\n\r\nThis is done at the same time in two terminal windows - first running Gulp watch and serving files with BrowserSync, second running webpack-dev-server. If you want to try it yourself, you can find full logs and files I used [here: (Gist)](https://gist.github.com/sasxa/85486bb62dc5dca3e48f6f385ef93135). Build works with CLI project with some modification - for `index.html` and `system.config.js` I used files from [docs/quickstart](https://angular.io/docs/ts/latest/quickstart.html) and modified them to fit my project. Only other thing needed to make it work is to remove `import './polyfills.ts';` from 'src/main.ts`.\r\n\r\nOK, now the reason I'm writing this is to share what I learned while trying to make this work, hopefully it will be useful and help improve CLI. \r\n\r\n\r\nStyling\r\n\n---\r\n* It would be nice if workflow with style pre-processors was easier: I'm using stylus and I couldn't find any options to include some shared files and mixins. In my project I created `src/styles/` folder where all my `.styl` files are and I'm importing them from `src/styles.styl` with `@import 'styles/defaults'`. I also have `src/styles/variables.styl` where I `@import \"C:/.library/styl/mixins.styl\"`... It would be nice if we had access to `stylus` to extend it, like I'm doing:\r\n```\r\n.pipe(__.stylus({\r\n    include: [\r\n      path.resolve(PATH.root, 'src'),\r\n      path.resolve(PATH.root, 'src', 'styles'),\r\n      path.resolve(PATH.lib, 'styl')]\r\n  }))\r\n```\r\n* Same goes for other modules (html-minifier, autoprefixer, csso...).  Since I couldn't setup paths where stylus looks for imports, I had to use `@import '../../styles/variables'` in my component styles, which I had to remove in order to process styles with Gulp `file.replace(/@import\\s+'(?:\\.\\.\\/)+/gmi, '@import \\'')`.\r\n\r\n* Another nice feature would be to have separate file for inline styles, that would be injected directly in `\u003chead>` while the rest are loaded normally, via `\u003clink>`. I think I saw something like this in early versions with `--mobile` and/or `--universal`... I saw some improvements with styles workflows on master branch, nice! Hope to see more (;\r\n\r\nDev builds\r\n\n---\r\n\r\n* Concerning module resolution, I'm using `\"compilerOptions.baseUrl\": \".\"` [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) so I can use `import {...} from 'app/core/service'` instead of `import {...} from '../../../../app/core/service'` in my components. Might be useful to be there by default? I saw some issues/PRs/commits with `import {...} from '@shared'` - not sure what's the status of that, but aliasing app root is really useful for me.\r\n\r\n* While building my gulp tasks I noticed that rebuilding typescript files seams to be main reason for high rebuild times. I chose to use settings that give me fastest results\r\n\r\n* I'm not bundling files, my components/services/modules etc. are in separate files. This allows me to utilize gulp's caching, so it will only process changed files:\r\n\r\n```\r\n  return gulp.src(files, {\r\n    since: gulp.lastRun('ts')\r\n  })\r\n```\r\n\r\n* I used `\"isolatedModules\": true,` compiler option to make this work. TypeScript now *Unconditionally emit imports for unresolved files.*, which also speed things up.\r\n\r\n* I'm injecting everything in js file - templates, styles, sourcemaps. It's not ideal, and sourcemaps are not precise, but I usually know what I'm doing, so most of the time I can find errors quickly. And if not, I can always use different options to track down bugs. With 50-250ms rebuild times I work differently then when I have to wait 5-15s... For production builds and various optimizations I really don't mind waiting 30-90s. \r\n\r\n* While I don't think something like this should be default option for CLI, perhaps there are some things you could turn off, or do differently to speed things up. Maybe provide some flag to turn off some safety checks, not bundle everything each time and such. I'm not that familiar with webpack to offer any suggestions, but maybe something I mentioned can help (;\r\n\r\nFinally, just to mention the dreadful systemjs... The way I have structured my modules and components is really, really painful to setup with systemjs. In fact, making it work took me almost as long as everything else... It was the reason why I was happy CLI switched to webpack. Working with CLI is soo much easier. If (or when!) CLI was 10x faster I would gladly forget everything about systemjs. Forever (:","author":{"url":"https://github.com/sasxa","@type":"Person","name":"sasxa"},"datePublished":"2016-10-31T03:04:01Z","url":"https://github.com/angular/angular-cli/issues/2956"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:203f6642-ea2b-44c0-0ff1-a018385fd64c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAACE:928E2:34C3517:4651B31:6B02024B
html-safe-nonce77314874cee5f86d195d49a41cddeede80bfa8823a0143dae734ed9502a164e7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUNFOjkyOEUyOjM0QzM1MTc6NDY1MUIzMTo2QjAyMDI0QiIsInZpc2l0b3JfaWQiOiI3NjM3MzYyOTQ5NzkwNzYxNTQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac30b7630b4c6b21eab651a576a165494e7ed53efbbc590cd3664ff3d92e837aca
hovercard-subject-tagissue:186193807
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/2956/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8fe06f11a33a314e6bea5078cb69029bbc9897963b628dbbc616bb992803c2a0/angular/angular-cli/issues/2956
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8fe06f11a33a314e6bea5078cb69029bbc9897963b628dbbc616bb992803c2a0/angular/angular-cli/issues/2956
og:image:altI just finished rewriting my old gulp build tasks to work with CLI. Results are... interesting :) #1980 CLI c:\project>ng s ** NG Live Development Server is running on http://localhost:4200. ** 179...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesasxa
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/2956#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F2956
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F2956
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/2956
Reloadhttps://github.com/angular/angular-cli/issues/2956
Reloadhttps://github.com/angular/angular-cli/issues/2956
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/2956
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/2956
Rebuild speed and style workflows (feedback)https://github.com/angular/angular-cli/issues/2956#top
https://github.com/sasxa
sasxahttps://github.com/sasxa
on Oct 31, 2016https://github.com/angular/angular-cli/issues/2956#issue-186193807
#1980https://github.com/angular/angular-cli/issues/1980
https://cloud.githubusercontent.com/assets/4272818/19841565/fef07b6e-9f0d-11e6-953e-142aefea1f85.PNG
https://cloud.githubusercontent.com/assets/4272818/19841566/fef089a6-9f0d-11e6-811f-3bebffc0fd48.PNG
here: (Gist)https://gist.github.com/sasxa/85486bb62dc5dca3e48f6f385ef93135
docs/quickstarthttps://angular.io/docs/ts/latest/quickstart.html
path mappinghttps://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
https://github.com/reco
recohttps://github.com/reco
on Oct 31, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-257451044
https://github.com/mralexivy
mralexivyhttps://github.com/mralexivy
on Nov 1, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-257630944
https://github.com/sasxa
sasxahttps://github.com/sasxa
on Nov 2, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-257759851
Image 1https://cloud.githubusercontent.com/assets/4272818/19914394/95ddf716-a0aa-11e6-8839-701b8ba67d2c.PNG
Image 2https://cloud.githubusercontent.com/assets/4272818/19914669/bcfe57c6-a0ac-11e6-92d9-68ad8acef6d7.PNG
https://github.com/hiepxanh
hiepxanhhttps://github.com/hiepxanh
on Nov 3, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-258057839
https://github.com/sasxa
sasxahttps://github.com/sasxa
on Nov 3, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-258255880
Image 2https://cloud.githubusercontent.com/assets/4272818/19914669/bcfe57c6-a0ac-11e6-92d9-68ad8acef6d7.PNG
Image 3https://cloud.githubusercontent.com/assets/4272818/19982282/c17177fc-a205-11e6-9445-d99d74dcefd6.PNG
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Nov 7, 2016https://github.com/angular/angular-cli/issues/2956#issuecomment-258866182
@sasxahttps://github.com/sasxa
#1980https://github.com/angular/angular-cli/issues/1980
Passing additional options to node-sass #1791https://github.com/angular/angular-cli/issues/1791
feat(sass resolve paths) #2747https://github.com/angular/angular-cli/pull/2747
#1980https://github.com/angular/angular-cli/issues/1980
filipesilvahttps://github.com/filipesilva
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 7, 2016https://github.com/angular/angular-cli/issues/2956#event-850046143
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 6, 2019https://github.com/angular/angular-cli/issues/2956#issuecomment-528768133
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 6, 2019https://github.com/angular/angular-cli/issues/2956#event-2613616275
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/2956
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/2956
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.