Skip to content

Add default assets configuration to Angular starter template #495

Description

@shubhamjrd4559-sudo

💡 Feature Description

Provide default asset mappings in newly generated Angular projects.

Currently, Angular projects generated from the starter template create an empty assets array inside angular.json:

"options": {
  "assets": []
}

This requires developers to manually configure asset copying before static resources such as images, favicons, fonts, manifests, and JSON files become available in build outputs.


🎯 Problem It Solves

Developers expect common asset directories such as:

src/assets/
public/

to work out of the box.

Without a default asset configuration:

  • Images and icons are not copied automatically.
  • Fonts require manual configuration.
  • Manifest and JSON files require additional setup.
  • Every new project requires repetitive configuration changes.
  • Developer onboarding becomes less smooth.

🔧 Proposed Solution

Update the Angular starter template responsible for generating angular.json.

Instead of:

"assets": []

generate a default configuration such as:

"assets": [
  {
    "glob": "**/*",
    "input": "public"
  },
  "src/assets"
]

This would provide sensible defaults while remaining customizable.


🔄 Alternatives Considered

Option 1

Keep the current configuration and document the setup process.

Drawback: Every developer must manually configure assets after project creation.

Option 2

Provide a CLI flag to generate asset mappings.

Drawback: Adds extra complexity for a common use case.

Preferred Option

Include default asset mappings in generated projects.


🖼️ Mockups / Examples

Current Output

"assets": []

Expected Output

"assets": [
  {
    "glob": "**/*",
    "input": "public"
  },
  "src/assets"
]

✅ Acceptance Criteria

  • New Angular projects include a default assets configuration.
  • Static resources inside public/ are copied during builds.
  • Static resources inside src/assets/ are copied during builds.
  • Existing project generation flow remains unaffected.
  • Documentation reflects the default asset behavior.

📌 Additional Context

Affected configuration:

angular.json
projects.<project-name>.architect.build.options.assets

Potential template source:

editron-starters/

This enhancement primarily improves Developer Experience (DX) by reducing manual setup steps in newly generated Angular projects.


🏁 Contributor Checklist

  • I am participating via GSSoC
  • I have read the contribution guidelines
  • I checked for existing issues before creating this

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions