Starter Kit for Angular v1.
Just use this kit as base code to start your Angular project
- Entry page source: /src/index.html
- All source files will be bundled into /app/
- Use Webpack 2 to bundle files
- Use LESS for CSS pre-process, but you can choose on your own such as SASS.
npm run dist
npm run dev
You can also use the following command to bundle all files and then start dev server.
npm start
starter-kit-angular/
├──app/ * all bundles
│
├──src/ * source files that will be all bundled to /app/dist/
| ├──index.html * app entry page source file
│ │
| ├──critical.js * critical process, such as page loading styles
| ├──critical.less * critical styles
│ │
| ├──main.js
| ├──main.less
│ │
│ ├──_core/ * core Javascript files
│ │ └──routers.less * Angular router configurations
│ │
│ ├──_core-less/ * core Less files
│ │ ├──_include.less * include all base Less files, you can include this file in all your Less files
│ │ ├──color.less * color configurations
│ │ ├──tools.less * base mixins
│ │ └──variables.less * other configurations
│ │
│ ├──_webpack/ * webpack configuration
│ │ ├──_base.js
│ │ ├──dev.js * will use this config for development environment
│ │ └──dist.js * will use this config for production environment
│ │
│ ├──templates/ * templates used for router
│ │ └──${template}.js
│ │
│ ├──controllers/
│ │ └──${controller}.js
│ │
│ ├──components/
│ │ └──${component}.js
│ │
│ └──services/
│ └──${service}.js
│
└──webpack.config.js * webpack main configuration file
You will noticed that there're services
, controllers
and components
folder under src
. These are used for my strategy for bundling services, controllers and components.
- Services and Controllers names are defined in
src/main.js
in arrayservices
andcontrollers
. - The process will find
src/services/${serviceName}
for the service by that name,src/controllers/${controllerName}
for the controller by that name andsrc/components/${componentName}
for the component by that name and then bundle them.