Yeoman generator for AngularJS + Webpack with ES6 and SASS.wiki
- Babel 6 with ES2017 features.
- Latest Webpack with Tree Shaking feature enabled.
- SASS as CSS preprocessor.
- Angular UI router as default router.
- Karma and Jasmine for testing.
- All necessary webpack loaders already included (Sass, Images, Fonts, ngAnnotate, ngTemplateCache, etc.)
- Proxy configured to make cross origin requests with a simple prefix.
- Automatic Application Documentation
βββ /config/ #Configurations
β βββ /webpack/ #Webpack config files
β β βββ /environments/ #Webpack env configs
β β β βββ /development.js #Development env config
β β β βββ /production.js #Production env config
β β βββ global.js #Global webpack config
βββ /dist/ #The built application directory to be deployed
βββ /docs/ #Application Documentation (Auto Generated)
β βββ /docs-assets/ #Application Documentation assets
β β βββ/docs.js #Application Documentation in JSON format (Auto Generated and editable)
β βββ /docs.html #Application Documentation HTML (Auto Generated)
βββ /node_modules/ #3rd-party libraries and utilities
βββ /src/ #Source folder
β βββ /app/ #Application code
β β βββ /components/ #Shared UI components
β β β βββ /component/ #Shared component. Place component's styles, components, directives, templates here
β β β β βββ /components/ #Nested components. Place nested components here.
β β β β βββ /directives/ #Component related directives.
β β β β βββ /services/ #Component services.
β β β β βββ /component.component-spec.js #Component unit tests JS
β β β β βββ /component.component.js #Component definition JS
β β β β βββ /component.component.html #Component template
β β β β βββ /component.module.js #Component module
β β β β βββ /component.component.scss #Component styles
β β βββ /core/ #Shared angular services/directives
β β β βββ /directives/ #Shared directives
β β β β βββ /directive/ #Shared directive. Place directive's templates and controller here.
β β β β β βββ /directive.directive-spec.js #Directive unit tests
β β β β β βββ /directive.directive.js #Directive definition, link and controller
β β β β β βββ /directive.html #Directive template (optional)
β β β β β βββ /directive.scss #Directive styles (optional)
β β β βββ /services/ #Shared services
β β β β βββ /service/ #Shared directive. Place directive's templates and controller here.
β β β β β βββ /service.factory-spec.js #Service unit tests
β β β β β βββ /service.factory.js #Service definition
β β β βββ /core.module.js #Import of all core components should be here
β β βββ /pages/ #All pages-dependent content should place here
β β β βββ /page/ #page
β β β β βββ /page.controller-spec.js #page Controller unit tests
β β β β βββ /page.controller.js #page Controller
β β β β βββ /page.html #page template
β β β β βββ /page.module.js #page module
β β β β βββ /page.route.js #page routes
β β β β βββ /page.scss #page styles
β β β βββ /.../ #Other pages...
β β βββ /index.bootstrap.js #Entry point. Import internal and external modules and bootstrap (RUN) angular application
β β βββ /index.components.js #Custom components definition
β β βββ /index.config.js #Function that will be triggered in Angular's "config" phase
β β βββ /index.module.js #Main application's module
β β βββ /index.routes.js #Describe only "otherwise" and async routes here
β β βββ /index.run.js #Function that will be triggered in Angular's "run" phase
β β βββ /index.vendor.js #Import all vendors and 3rd party plugins here
β βββ /assets/ #Static content
β β βββ /data/ #Data (e.g: JSON files)
β β βββ /fonts/ #Fonts
β β βββ /images/ #Images
β β βββ /js/ #Extra libs folder
β β βββ /styles/ #Styles folder
β β βββ /css/ #CSS, place external css files here
β β βββ /sass/ #SASS
β β βββ /fonts.scss #Fonts SASS file, define your fonts here.
β β βββ /index.scss #Index SASS entry file, bundles all SASS files.
β β βββ /main.scss #Main SASS file, define your global styling here.
β βββ favicon.ico #Application icon to be displayed in bookmarks
β βββ tpl-index.ejs #Template for html-webpack-plugin that will be transpiled into index.html in /dist
βββ .babelrc #Babel config with presets and plugins
βββ .editorconfig #Editor config to help developers define and maintain consistent coding styles.
βββ .eslintrc.json #eslint config with parse options, rules, etc.
βββ .gitignore #List of files to ignore by git
βββ .yo-rc.json #Defines the root of the project, allows your user to run commands in subdirectories.
βββ karma.conf.js #Karma configuration file for testing
βββ package.json #The list of project dependencies and NPM scripts
βββ README.md #README file
βββ test-context.js #Test context, '*-spec.js' files
βββ webpack.config.js #Bundling and optimization settings for Webpack
Prerequisites: Node, Yeoman and Webpack.
- To install Node, visit nodeJS
- To install Yeoman and Webpack:
npm install -g yo webpack
Next, install this generator:
npm i -g generator-at-angular
Creating a project:
mkdir MyAwesomeApp && cd $_
yo at-angular
Running a generator:
yo at-angular # Generates an angular appplication
yo at-angular:page my-page # Generates a page (partial)
yo at-angular:service my-service # Generates a service
yo at-angular:service my-component/my-service # Generates a service in a component
yo at-angular:directive my-directive # Generates a shared directive
yo at-angular:directive my-component/my-directive # Generates a directive in a component
yo at-angular:component my-component # Generates a component
yo at-angular:component my-component/my-nested-component # Generates a nested component
yo at-angular:component my-component/my-nested-component/... # Generates a multiple nested component
yo at-angular:remove # Runs the at removal tool to remove a generated item
Running the project:
npm start
or npm run dev
- To start development server on localhost:8080.
npm run build
- To make production-ready build run after few moments you will see build id dist
folder.
- Angular Material: UI Component framework provides a set of reusable UI components based on Googleβs Material Design. https://material.angularjs.org/latest/getting-started
- Boostrap Sass: bootstrap-sass is a Sass-powered version of Bootstrap (Once Boostrap 4 is stable it'll be used instead of 3)
- Automatic Application Documentation
- Documentation can be view in docs/docs.html which is a simple angular application to view the docs in a neat way.
- The Documentation itself is stored in docs/docs-assets/docs.js in JSON that can be edited and customized.
- To create an angular application quickly using the defaults run
yo at-angular --d
oryo at-angular --default
- To create an angular application quickly using the DREIDEV structure and defaults run
yo at-angular --dreidev
- To keep the SASS/SCSS clean and modular use BEM Syntax
- To keep the git repository's branch model modular and scalable use git flow
- For more information about versions, features and migration check the wiki
- For help, questions, feature requests and bug reports, submit an issue
In your package.json replace
"extract-text-webpack-plugin": "^2.0.0-beta.4",
with "extract-text-webpack-plugin": "2.0.0-beta.5",