-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated dependencies Better commonjs interop Added a number of build examples Fixes #166 Fixes #183 Fixes #185
- Loading branch information
Showing
26 changed files
with
312 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ coverage/Firefox*/* | |
coverage/ | ||
|
||
bower_components/ | ||
|
||
build_examples/**/bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Running `browserify app.js > bundle.js` in this directory will produce `bundle.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var angular = require('angular'); | ||
|
||
angular.module('app', [ | ||
// this is what you would do in a real app | ||
// require('angular-cache') | ||
|
||
// for the example to work | ||
require('../../dist/angular-cache.js') | ||
]).run(function ($rootScope, CacheFactory) { | ||
$rootScope.test = 'It works! Using ' + (CacheFactory ? 'angular-cache' : 'undefined'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="app"> | ||
<head> | ||
<title>My App</title> | ||
<!-- load bundled scripts --> | ||
<script src="bundle.js"></script> | ||
</head> | ||
<body> | ||
<h1>{{ test }}</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Running `r.js -o require.config.js` in this directory will produce `bundle.js` | ||
|
||
In `index.html` switch `script/main` between `main` (load scripts dynamically) and `bundle` (load bundled scripts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define('app', [ | ||
'angular', | ||
'angular-cache' | ||
], function (angular, angularCacheModuleName) { | ||
return angular.module('app', ['angular-cache']) | ||
.run(function ($rootScope) { | ||
$rootScope.test = 'It works! Using ' + angularCacheModuleName; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>My App</title> | ||
<!-- load scripts dynamically --> | ||
<script data-main="main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script> | ||
|
||
<!-- load bundled scripts --> | ||
<!--<script data-main="bundle" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>--> | ||
</head> | ||
<body ng-cloak> | ||
<h1>{{ test }}</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require.config({ | ||
paths: { | ||
angular: '../../bower_components/angular/angular', | ||
'angular-cache': '../../dist/angular-cache', | ||
}, | ||
shim: { | ||
'angular': { | ||
exports: 'angular' | ||
} | ||
} | ||
}); | ||
|
||
require([ | ||
'angular', | ||
'app' | ||
], function (angular, app) { | ||
angular.element(document.getElementsByTagName('html')[0]).ready(function () { | ||
// bootstrap the app manually | ||
angular.bootstrap(document, ['app']); | ||
}); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
({ | ||
name: 'main', | ||
mainConfigFile: 'main.js', | ||
out: 'bundle.js', | ||
optimize: 'none' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Running `webpack` in this directory will produce `bundle.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var angular = require('angular'); | ||
var angularCacheModuleName = require('angular-cache'); | ||
|
||
var app = angular.module('app', [ | ||
angularCacheModuleName | ||
]).run(function ($rootScope) { | ||
$rootScope.test = 'It works, imported ' + angularCacheModuleName; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="app"> | ||
<head> | ||
<title>My App</title> | ||
<!-- load bundled scripts --> | ||
<script src="bundle.js"></script> | ||
</head> | ||
<body> | ||
<h1>{{ test }}</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
entry: './app.js', | ||
output: { | ||
filename: 'bundle.js' | ||
}, | ||
resolve: { | ||
alias: { | ||
'angular-cache': '../../dist/angular-cache.js' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Running `webpack` in this directory will produce `bundle.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import angular from 'angular'; | ||
import angularCacheModuleName from 'angular-cache'; | ||
|
||
let app = angular.module('app', [ | ||
angularCacheModuleName | ||
]).run($rootScope => { | ||
$rootScope.test = 'It works, imported ' + angularCacheModuleName; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="app"> | ||
<head> | ||
<title>My App</title> | ||
<!-- load bundled scripts --> | ||
<script src="bundle.js"></script> | ||
</head> | ||
<body> | ||
<h1>{{ test }}</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
entry: './app.js', | ||
output: { | ||
filename: 'bundle.js' | ||
}, | ||
resolve: { | ||
alias: { | ||
'angular-cache': '../../dist/angular-cache.js' | ||
} | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' } | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Running `webpack` in this directory will produce `bundle.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'angular'; | ||
import 'angular-cache'; | ||
|
||
let app = angular.module('app', [ | ||
'angular-cache' | ||
]).run(($rootScope, CacheFactory) => { | ||
$rootScope.test = 'It works, imported ' + (CacheFactory ? 'angular-cache' : 'undefined'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="app"> | ||
<head> | ||
<title>My App</title> | ||
<!-- load bundled scripts --> | ||
<script src="bundle.js"></script> | ||
</head> | ||
<body> | ||
<h1>{{ test }}</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
entry: './app.js', | ||
output: { | ||
filename: 'bundle.js' | ||
}, | ||
resolve: { | ||
alias: { | ||
'angular-cache': '../../dist/angular-cache.js' | ||
} | ||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' } | ||
] | ||
} | ||
}; |
Oops, something went wrong.