-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From now on angular2-google-maps ships an UMD bundle named `core.umd.js`. BREAKING CHANGES The SystemJS based bundle located in the `bundles/` dir is gone! Please use the new UMD bundle. SystemJS example: ```js SystemJS.config({ packages: { 'angular2-google-maps/core': { main: 'core.umd.js', defaultExtension: 'js' } } }) ```
- Loading branch information
1 parent
00f4f2d
commit 531110d
Showing
17 changed files
with
179 additions
and
166 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "airbnb", | ||
"extends": "airbnb-base", | ||
"rules": { | ||
"id-length": 0 | ||
} | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
5.0.0 | ||
5 |
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
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
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 |
---|---|---|
@@ -1,55 +1,17 @@ | ||
const gulp = require('gulp'); | ||
const config = require('./config'); | ||
const path = require('path'); | ||
const $ = require('gulp-load-plugins')(); | ||
const Builder = require('systemjs-builder'); | ||
|
||
const bundleConfig = { | ||
baseURL: config.PATHS.dist.cjs, | ||
defaultJSExtensions: true, | ||
paths: { | ||
'angular2-google-maps/*': '*', | ||
'@angular/*': './node_modules/@angular/*', | ||
'rxjs/*': './node_modules/rxjs/*', | ||
}, | ||
packages: { | ||
'@angular/core': { main: 'index.js', defaultExtension: 'js' }, | ||
'@angular/common': { main: 'index.js', defaultExtension: 'js' }, | ||
'@angular/compiler': { main: 'index.js', defaultExtension: 'js' }, | ||
}, | ||
map: { | ||
'@angular': '@angular', | ||
}, | ||
}; | ||
const tsCmd = `./node_modules/.bin/tsc --out ${config.PATHS.dist.cjs}core.umd.js ` + | ||
`--target es5 --allowJs ${config.PATHS.tmp}core.umd.js`; | ||
|
||
function bundle(moduleName, moduleBundleName, minify, done) { | ||
const outputConfig = { | ||
sourceMaps: true, | ||
minify: minify, | ||
}; | ||
const builder = new Builder(); | ||
builder.config(bundleConfig); | ||
const outputFile = path.join(config.PATHS.dist.bundles, moduleBundleName + (minify ? '.min' : '') + '.js'); | ||
// todo: newest systemjs-builder version requires to explicitly exclude .d.ts files - probably a systemjs-builder bug. | ||
const bundlePromise = builder.bundle(moduleName + ' - @angular/core/*.ts - @angular/core/*.js - rxjs/*.ts - rxjs/*.js', outputFile, outputConfig); | ||
gulp.task('rollup:umd', ['scripts:esm'], | ||
$.shell.task('./node_modules/.bin/rollup -c rollup.config.js')); | ||
|
||
if (!minify) { | ||
bundlePromise.then(() => { | ||
gulp.src(outputFile) | ||
.pipe($.connect.reload()); | ||
}); | ||
} | ||
return bundlePromise.then(() => { | ||
done(); | ||
}); | ||
} | ||
gulp.task('bundle:umd', ['rollup:umd'], $.shell.task(tsCmd, { ignoreErrors: true })); | ||
|
||
gulp.task('bundle:cjs', ['scripts:cjs'], function bundleCjs(done) { | ||
bundle('angular2-google-maps/core', 'angular2-google-maps', false, done); | ||
gulp.task('bundle:umd:min', ['bundle:umd'], (done) => { | ||
done(); | ||
}); | ||
|
||
gulp.task('bundle:cjs:min', ['scripts:cjs'], function bundleCjsMin(done) { | ||
bundle('angular2-google-maps/core', 'angular2-google-maps', true, done); | ||
}); | ||
|
||
gulp.task('bundle', ['bundle:cjs', 'bundle:cjs:min']); | ||
gulp.task('bundle', ['bundle:umd', 'bundle:umd:min']); |
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
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
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
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
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
Oops, something went wrong.