* Splash Page
*/
-angular.module('egHome', ['ngRoute', 'ui.bootstrap', 'egCoreMod', 'egUiMod'])
+//import angular from 'angular';
+import angular from 'angular';
+import ngRoute from 'angular-route';
+import uiBootstrap from 'angular-ui-bootstrap';
+import egCoreMod from './services/core.js';
+import egUiMod from './services/ui.js';
+
+angular.module('egHome', [ngRoute, uiBootstrap, egCoreMod, egUiMod])
.config(
['$routeProvider','$locationProvider',
const path = require('path');
const merge = require('webpack-merge');
+const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
'./services/lovefield.js'
];
-
-// 3rd-party (AKA vendor) JS files loaded on every page. NOTE:
-// using the un-minified versions of each so we can apply consistent
-// minification via webpack and optionally build inline source maps.
+// 3rd-party (AKA vendor) JS files loaded on every page.
+// Webpack knows to look in ./node_modules/
const vendorJsFiles = [
- './node_modules/angular/angular.js',
- './node_modules/angular-route/angular-route.js',
- './node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js',
- './node_modules/angular-hotkeys/build/hotkeys.js',
- './node_modules/angular-file-saver/dist/angular-file-saver.bundle.js',
- './node_modules/angular-location-update/angular-location-update.js',
- './node_modules/angular-animate/angular-animate.js',
- './node_modules/angular-sanitize/angular-sanitize.js',
- './node_modules/angular-cookies/angular-cookies.js',
- './node_modules/ng-toast/dist/ngToast.js',
- './node_modules/angular-tree-control/angular-tree-control.js',
- './node_modules/iframe-resizer/js/iframeResizer.js',
- './node_modules/angular-order-object-by/src/ng-order-object-by.js',
- './node_modules/lovefield/dist/lovefield.js'
+ 'angular',
+ 'angular-route',
+ 'angular-ui-bootstrap',
+ 'angular-hotkeys',
+ 'angular-file-saver',
+ 'angular-location-update',
+ 'angular-animate',
+ 'angular-sanitize',
+ 'angular-cookies',
+ 'ng-toast',
+ 'angular-tree-control',
+ 'iframe-resizer',
+ 'angular-order-object-by',
+ 'lovefield'
];
// As of today, we are only bundling common files. Individual app.js
// and optional service files are still imported via script tags.
entry: {
+ app: './app.js',
core: coreJsFiles,
vendor: vendorJsFiles
},
plugins: [
new CleanWebpackPlugin([buildPath]),
- new CopyWebpackPlugin(directCopyFiles, {copyUnmodified: true})
+ new CopyWebpackPlugin(directCopyFiles, {copyUnmodified: true}),
+ new webpack.optimize.CommonsChunkPlugin({
+ names: ['core', 'vendor'], // ORDER MATTERS
+ minChunks: 2 // TODO: huh?
+ })
],
output: {
filename: 'js/[name].bundle.js',
path: path.resolve(__dirname, buildPath)
}
-
};
// improve debugging during development with inline source maps
// TODO: Add other bundles as necessary, but leave the 'vendor'
// bundle out, since we always want to minify that (it's big).
new UglifyJSPlugin({
- exclude: [/core/]
+ exclude: [/core/, /app/]
})
],
watchOptions: {