Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Commit

Permalink
Adding visualizer plugin (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Oct 18, 2016
1 parent 914254a commit ba46a89
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 13 deletions.
3 changes: 2 additions & 1 deletion etc/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var appConfig = {
srcIMG: path.resolve(sourceRoot, 'img'),
index: path.resolve(sourceRoot, 'index.html'),
dist: distRoot,
distPath: distPath
distPath: distPath,
additionalWebpackOptions: false
};

module.exports = appConfig;
2 changes: 1 addition & 1 deletion etc/karma.conf.ci.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/
const baseConfig = require('./karma.conf.js');
const defaultAppConfig = require('./appConfig');
Expand Down
2 changes: 1 addition & 1 deletion etc/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/
const defaultAppConfig = require('./appConfig');
const appConfig = require(process.env.APP_CONFIG || './appConfig');
Expand Down
2 changes: 1 addition & 1 deletion etc/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

require('ts-node/register');
Expand Down
12 changes: 11 additions & 1 deletion etc/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const webpack = require('webpack');
const path = require('path');
const helpers = require('./helpers');
const appConfig = require(process.env.APP_CONFIG || './appConfig');
const debugLog = util.debuglog('@holisticon/angular-common/webpack.common');

/*
* Webpack Plugins
Expand All @@ -12,6 +13,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
const HtmlElementsPlugin = require('./html-elements-plugin');

debugLog('Using following appConfig:', appConfig);
/*
* Webpack Constants
*/
Expand All @@ -26,7 +28,7 @@ const METADATA = {
*
* See: http://webpack.github.io/docs/configuration.html#cli
*/
module.exports = {
var config = {

/*
* Static metadata for index.html
Expand Down Expand Up @@ -289,3 +291,11 @@ module.exports = {
}

};


// add additional settings here
if (appConfig.additionalWebpackOptions) {
config = webpackMerge(config, appConfig.additionalWebpackOptions);
}
debugLog('Using following webpack common config:', config);
module.exports = config;
9 changes: 7 additions & 2 deletions etc/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

const appConfig = require(process.env.APP_CONFIG || './appConfig');
Expand All @@ -11,6 +11,7 @@ const commonConfig = require('./webpack.common.js'); // the settings that are co
* Webpack Plugins
*/
const DefinePlugin = require('webpack/lib/DefinePlugin');
const VisualizerPlugin = require('webpack-visualizer-plugin');

/**
* Webpack Constants
Expand Down Expand Up @@ -91,7 +92,7 @@ module.exports = webpackMerge(commonConfig, {
chunkFilename: '[id].chunk.js',

library: 'ac_[name]',
libraryTarget: 'var',
libraryTarget: 'var'
},

plugins: [
Expand All @@ -115,6 +116,10 @@ module.exports = webpackMerge(commonConfig, {
'HMR': METADATA.HMR,
}
}),
// see https://github.com/chrisbateman/webpack-visualizer#plugin-usage
new VisualizerPlugin({
filename: './statistics.html'
})
],

/**
Expand Down
2 changes: 1 addition & 1 deletion etc/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

const appConfig = require(process.env.APP_CONFIG || './appConfig');
Expand Down
2 changes: 1 addition & 1 deletion etc/webpack.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

const appConfig = require(process.env.APP_CONFIG || './appConfig');
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.ci.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

// Look in ./config for karma.conf.js
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

// Look in ./config for karma.conf.js
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"webpack": "2.1.0-beta.22",
"webpack-dev-server": "2.1.0-beta.2",
"webpack-md5-hash": "0.0.5",
"webpack-merge": "0.14.1"
"webpack-merge": "0.14.1",
"webpack-visualizer-plugin": "^0.1.5"
},
"devDependencies": {
"@angular/common": "2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author: @martinreinhardt
* @author: hypery2k
*/

// Look in ./config folder for webpack.dev.js
Expand Down

0 comments on commit ba46a89

Please sign in to comment.