Skip to content

Commit

Permalink
feat(build): Publish non-monolithic UMD bundle ui-router-angularjs.js
Browse files Browse the repository at this point in the history
This enables ui-router plugin support when using script tags

Fixes #3418
  • Loading branch information
christopherthielen committed May 6, 2017
1 parent f535f42 commit 8db3696
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
24 changes: 23 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ import sourcemaps from 'rollup-plugin-sourcemaps';
import visualizer from 'rollup-plugin-visualizer';

var MINIFY = process.env.MINIFY;
var MONOLITHIC = process.env.MONOLITHIC;
var ROUTER = process.env.ROUTER;
var EVENTS = process.env.EVENTS;
var RESOLVE = process.env.RESOLVE;

var pkg = require('./package.json');
var banner =
`/**
* ${pkg.description}
* ${pkg.description}`;
if (ROUTER && MONOLITHIC) {
banner += `
* NOTICE: This monolithic bundle also bundles the @uirouter/core code.
* This causes it to be incompatible with plugins that depend on @uirouter/core.
* We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.
* For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles`
} else if (ROUTER) {
banner += `
* This bundle requires the ui-router-core.js bundle from the @uirouter/core package.`
}
banner += `
* @version v${pkg.version}
* @link ${pkg.homepage}
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -43,6 +55,15 @@ const BASE_CONFIG = {
};

const ROUTER_CONFIG = Object.assign({
moduleName: '@uirouter/angularjs',
entry: 'lib-esm/index.js',
dest: 'release/ui-router-angularjs' + extension,
globals: { angular: 'angular', '@uirouter/core': '@uirouter/core' },
external: ['angular', '@uirouter/core'],
}, BASE_CONFIG);

// Also bundles the code from @uirouter/core into the same bundle
const MONOLITHIC_ROUTER_CONFIG = Object.assign({
moduleName: '@uirouter/angularjs',
entry: 'lib-esm/index.js',
dest: 'release/angular-ui-router' + extension,
Expand All @@ -69,6 +90,7 @@ const RESOLVE_CONFIG = Object.assign({}, BASE_CONFIG, {
const CONFIG =
RESOLVE ? RESOLVE_CONFIG :
EVENTS ? EVENTS_CONFIG :
MONOLITHIC ? MONOLITHIC_ROUTER_CONFIG :
ROUTER ? ROUTER_CONFIG : ROUTER_CONFIG;

export default CONFIG;
27 changes: 0 additions & 27 deletions webpack.core-adapter.js

This file was deleted.

0 comments on commit 8db3696

Please sign in to comment.