Skip to content

Commit

Permalink
Build improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev committed Jul 24, 2016
1 parent 6ca642e commit 9d26344
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
11 changes: 9 additions & 2 deletions app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<h1>Hello, World!</h1>
`
<div>
<h1>Hello, World!</h1>
</div>
`,
styles: [`
h1 {
color: blue;
}
`]
})
export default class App {

Expand Down
2 changes: 0 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@
</head>
<body>
<my-app></my-app>

<script src="/bundle.js"></script>
</body>
</html>
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
"test:unit": "karma start",
"unit": "npm run test:unit -- --auto-watch --no-single-run",
"test": "echo \"Error: no test specified\" && exit 1",
"clean-dist": "rimraf dist",
"copy-files": "cpy app/index.html dist",
"clean-and-copy": "npm run clean-dist && npm run copy-files",
"prebuild:prod": "npm run clean-and-copy",
"build": "webpack --env.dev",
"build:prod": "webpack --env.prod -p",
"prestart": "npm run clean-and-copy",
"clean": "rimraf dist",
"prebuild": "npm run clean",
"build": "webpack",
"build:dev": "npm run build -- --env.dev",
"build:prod": "npm run build -- --env.prod -p",
"prestart": "npm run clean",
"start": "webpack-dev-server --history-api-fallback --env.dev --content-base dist"
},
"repository": {
Expand All @@ -34,12 +33,13 @@
"babel-core": "6.8.0",
"babel-eslint": "6.0.4",
"babel-loader": "6.2.4",
"babel-plugin-__coverage__": "0.111111.11",
"babel-plugin-__coverage__": "^11.0.0",
"babel-preset-es2015-webpack": "6.4.1",
"cpy-cli": "1.0.0",
"css-loader": "0.23.1",
"eslint": "2.9.0",
"eslint-loader": "1.3.0",
"html-webpack-plugin": "^2.22.0",
"jasmine-core": "2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^1.0.1",
Expand All @@ -53,7 +53,7 @@
"style-loader": "0.13.1",
"ts-loader": "^0.8.2",
"typescript": "^2.0.0",
"webpack": "2.1.0-beta.7",
"webpack": "^2.1.0-beta.20",
"webpack-dev-server": "2.0.0-beta"
},
"dependencies": {
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const {resolve} = require('path')
const {DefinePlugin, optimize} = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = function createWebpackConfig(env) {
const DEFAULT_PLUGINS = [
new DefinePlugin({
PROD: JSON.stringify(env.prod)
}),
new HtmlWebpackPlugin({
template: './app/index.html'
})
];

Expand Down

0 comments on commit 9d26344

Please sign in to comment.