Skip to content

Instantly share code, notes, and snippets.

@carlosrymer
Created July 30, 2017 15:35
Show Gist options
  • Save carlosrymer/553bc9695289b8f0d2e20127cccb808b to your computer and use it in GitHub Desktop.
Save carlosrymer/553bc9695289b8f0d2e20127cccb808b to your computer and use it in GitHub Desktop.
A sample entry file for an Angular 1.x application using Wepback 3 and undergoing a slow transition to ES6 modules.
// Core Styles
import './index.scss';
// Core Angular
import angular from 'angular';
// These all export the module name
import ngAnimateModuleName from 'angular-animate';
import ngAriaModuleName from 'angular-aria';
import ngCookiesModuleName from 'angular-cookies';
import ngMaterialModuleName from 'angular-material';
import ngMessagesModuleName from 'angular-messages';
import ngRouteModuleName from 'angular-route';
import ngSanitizeModuleName from 'angular-sanitize';
import ngTouchModuleName from 'angular-touch';
// Modules
import 'common/components/1'; // Paths are just examples
import 'common/components/2';
import 'common/components/3';
import 'common/components/4';
import 'common/services/1';
import 'common/services/2';
import 'common/services/3';
import 'common/services/4';
import 'pages/1';
import 'pages/2';
import 'pages/3';
import 'pages/4';
const dependencies = [
ngAnimateModuleName,
ngAriaModuleName,
ngCookiesModuleName,
ngMaterialModuleName,
ngMessagesModuleName,
ngRouteModuleName,
ngSanitizeModuleName,
'index.common.components.footer',
'index.common.components.header',
'index.common.components.menu',
'index.common.components.title',
'index.pages',
'index.common.services.authInterceptor',
'index.common.services.pageMetadata'
];
// Include the ngTouch module if touch is supported
if (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch) {
dependencies.push(ngTouchModuleName);
}
angular.module('index', dependencies)
.controller('IndexCtrl', function() {
// Controller code
})
.config(function() {
// Config code
});
@zoellner
Copy link

how would common/services/1 look like in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment