Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Aug 24, 2016
2 parents 88c5bb5 + 8390a1d commit 561b681
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
3 changes: 1 addition & 2 deletions config/webpack/client/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ module.exports = webpackMerge(commonConfig, {

loaders: [
{test: /\.ts$/, loader: 'awesome-typescript-loader', exclude: [/\.(spec|e2e)\.ts$/]},
{test: /\.css|.svg$/, loader: 'raw-loader'}
{test: /\.svg$/, loader: 'raw'}, {test: /\.css$/, loader: 'css?minimize'}
]
},

plugins: [
new ForkCheckerPlugin(), new OccurrenceOrderPlugin(true),
new CommonsChunkPlugin({name: ['vendor', 'polyfills']}),
new CopyWebpackPlugin([{from: 'src/client/assets/images', to: 'images'}]),
new CopyWebpackPlugin([{from: 'src/client/base.css', to: 'base.css'}]),
new HtmlWebpackPlugin({template: 'src/client/index.html', chunksSortMode: 'dependency'}),
new DefinePlugin({'ENV': JSON.stringify(ENV)})
],
Expand Down
15 changes: 13 additions & 2 deletions config/webpack/client/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,26 @@ module.exports = webpackMerge(commonConfig, {
query: {'compilerOptions': {'removeComments': true}},
exclude: [/\.(spec|e2e)\.ts$/]
},
{test: /\.css|.svg$/, loader: 'raw-loader'}
{test: /\.svg$/, loader: 'raw'},
{test: /\.css$/, loader: 'css?minimize'},
]
},

plugins: [
new ForkCheckerPlugin(), new OccurrenceOrderPlugin(true),
new CommonsChunkPlugin({name: ['vendor', 'polyfills']}), new WebpackMd5Hash(),
new DedupePlugin(), new CopyWebpackPlugin([{from: 'src/client/assets/images', to: 'images'}]),
new HtmlWebpackPlugin({template: 'src/client/index.html', chunksSortMode: 'dependency'}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
chunksSortMode: 'dependency',
minify: {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeOptionalTags: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
}),
new DefinePlugin({'ENV': JSON.stringify(ENV)}),
new UglifyJsPlugin({beautify: false, mangle: {keep_fnames: true}, comments: false}),
new CompressionPlugin(
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
"compression-webpack-plugin": "^0.3.1",
"copy-webpack-plugin": "^3.0.0",
"coveralls": "^2.11.9",
"css-loader": "^0.23.1",
"glob": "^7.0.3",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.14.0",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine": "^2.4.1",
Expand All @@ -136,7 +138,6 @@
"sauce-connect-launcher": "^0.15.1",
"source-map-loader": "^0.1.5",
"standard-version": "^2.2.1",
"style-loader": "^0.13.1",
"tslint": "^3.15.0",
"tslint-loader": "^2.1.3",
"typings": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/client/build/build.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {ShopComponent} from './shop/shop.component';
LoadingComponent, RetryComponent
],
encapsulation: ViewEncapsulation.None,
styles: [require('./build.css')],
styles: [require('./build.css').toString()],
template: `
<div class="title">
<img *ngIf="champion" [ddragon]="'champion/' + champion?.image?.full">
Expand Down
2 changes: 1 addition & 1 deletion src/client/champions/champions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {TagsPipe} from './pipes/tags.pipe';
NgFor, NgIf, FiltersComponent, BarComponent, LoadingComponent, RetryComponent, DDragonDirective
],
encapsulation: ViewEncapsulation.None,
styles: [require('./champions.css')],
styles: [require('./champions.css').toString()],
template: `
<filters [(name)]="name" [(tags)]="tags" [(sort)]="sort" (enterHit)="enterHit()"></filters>
<div class="champion" *ngFor="let champion of champions?.data | toIterable | name:name | sort:sort | tags:tags">
Expand Down
6 changes: 4 additions & 2 deletions src/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
<title><%= webpackConfig.metadata.title %></title>

<meta charset="utf-8">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%= webpackConfig.metadata.title %>">

<link rel="shortcut icon" href="/images/favicon.ico" />
<link href='https://fonts.googleapis.com/css?family=Roboto:400' rel='stylesheet' type='text/css'>
<link href='/base.css' rel='stylesheet' type='text/css'>

<base href="<%= webpackConfig.metadata.baseUrl %>">

<style>
<%= require('./base.css') %>
</style>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion src/client/region/region.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {LolApiService} from '../services/lolapi.service';
directives: [NgFor],
pipes: [ToIterablePipe],
encapsulation: ViewEncapsulation.None,
styles: [require('./region.css')],
styles: [require('./region.css').toString()],
template: `
<div class="align-center">
<h2>Select your region:</h2>
Expand Down

0 comments on commit 561b681

Please sign in to comment.