Skip to content

Commit

Permalink
build config
Browse files Browse the repository at this point in the history
  • Loading branch information
greengerong committed Aug 8, 2016
1 parent 38e059a commit 2e18933
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 28 deletions.
13 changes: 10 additions & 3 deletions build/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ module.exports = {
],

/*
* Include polyfills or mocks for various node stuff
* Description: Node configuration
* Plugin: postcss-loader
* Description: PostCSS loader for webpack to postprocesses your CSS with PostCSS plugins.
*
* See: https://webpack.github.io/docs/configuration.html#node
* See: https://github.com/postcss/postcss-loader
*/
postcss: [
cssnano({
Expand All @@ -274,6 +274,13 @@ module.exports = {
sourcemap: true
})
],

/*
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
node: {
global: 'window',
crypto: 'empty',
Expand Down
4 changes: 4 additions & 0 deletions build/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ const DEV_METADATA = require('../config/development.json');
const DefinePlugin = require('webpack/lib/DefinePlugin');

const ENV = process.env.ENV = process.env.NODE_ENV = 'development';
const HOST = process.env.HOST || 'localhost';
const PORT = process.env.PORT || 3000;
const HMR = utils.hasProcessFlag('hot');

const METADATA = webpackMerge(commonConfig.metadata, DEV_METADATA, {
host: HOST,
port: PORT,
ENV: ENV,
HMR: HMR
});
Expand Down
1 change: 1 addition & 0 deletions build/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const PROD_METADATA = require('../config/production.json');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const HOST = process.env.HOST || 'localhost';
const PORT = process.env.PORT || 8080;

const METADATA = webpackMerge(commonConfig.metadata, PROD_METADATA, {
host: HOST,
port: PORT,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/source-map": "^0.1.26",
"@types/uglify-js": "^2.0.27",
"@types/webpack": "^1.12.29",
"angular2-hmr": "^0.8.1",
"awesome-typescript-loader": "^1.1.1",
"babel-core": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
Expand Down
8 changes: 1 addition & 7 deletions src/app/common/loading/loading.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="loading ">
<div class="loading ">
<div class="circle">
<div class="spinner-container container1">
<div class="circle1"></div>
Expand All @@ -21,9 +21,3 @@
</div>
</div>

<!--
<div class="loading">
<strong> Loading...</strong>
<span></span>
</div>
-->
40 changes: 29 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<link rel="apple-touch-icon" sizes="144x144" href="/assets/icon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/assets/icon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/assets/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="192x192" href="/assets/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/assets/icon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icon/favicon-16x16.png">
Expand All @@ -34,21 +34,39 @@

<!-- base url -->
<base href="<%= webpackConfig.metadata.baseUrl %>">
<link rel="stylesheet" href="./assets/css/loading.css" />
<link rel="stylesheet" href="./assets/css/loading.css"/>
</head>

<body>
<app>
<div class="loading">
<strong> Loading...</strong>
<span></span>
<app>
<div class="loading ">
<div class="circle">
<div class="spinner-container container1">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
<div class="spinner-container container2">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
<div class="spinner-container container3">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
</div>
</app>
</div>
</app>

<% if (webpackConfig.metadata.ENV === 'development') { %>
<!-- Webpack Dev Server reload -->
<script src="/webpack-dev-server.js"></script>
<% } %>
<% if (webpackConfig.metadata.ENV === 'development') { %>
<!-- Webpack Dev Server reload -->
<script src="/webpack-dev-server.js"></script>
<% } %>

</body>

Expand Down
15 changes: 8 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"lib": [
"es6",
"dom"
],
"strictNullChecks": false,
"baseUrl": "./src",
"paths": [],
"paths": [
],
"lib": [
"dom",
"es6"
],
"types": [
"core-js",
"hammerjs",
"jasmine",
"node",
Expand All @@ -25,7 +25,8 @@
]
},
"exclude": [
"node_modules"
"node_modules",
"dist"
],
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
Expand Down

0 comments on commit 2e18933

Please sign in to comment.