Nigh on the simplest possible dev+dist build for Angular 1, TypeScript, WebPack using typings.
Heavily inspired by https://github.com/brechtbilliet/angular-typescript-webpack
npm install -g webpack typings typescript
npm install
npm dev
npm build
- Simple to read and follow what's going on - no stupidly complex build steps
- Minimal Webpack-isms in application code
- Minimal repitition
- Fast dev-time change-refresh cycle
- Templates should be able to work without
require
, thus removingglobals.d.ts
- Should be no warnings for
npm run build
- Tree-shaking
Module.component({
template: require("./template.html")
});
import "filename.scss"
// foo/foo.ts
import * as angular from "angular"
var FooModule = angular.module("app.foo", []);
FooModule.component("foo", {
template: require("./foo.html")
});
export default FooModule;
// Containing component declaration
import * as angular from "angular"
import FooModule from "./foo/foo"
var ContainingModule = angular.module("app", [
FooModule.name
]);
ContainingModule.component({/*...*/});
export default ContainingModule;