mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(build): generate umd bundle for plunkr
This commit is contained in:
@ -15,6 +15,8 @@ export const NODE_MODULES = 'node_modules';
|
|||||||
export const UMD_MODULE = 'umd';
|
export const UMD_MODULE = 'umd';
|
||||||
export const ES_2015 = 'es2015';
|
export const ES_2015 = 'es2015';
|
||||||
export const ES5 = 'es5';
|
export const ES5 = 'es5';
|
||||||
|
export const INDEX_JS = 'index.js';
|
||||||
|
export const BUNDLES = 'bundles';
|
||||||
|
|
||||||
// File Paths
|
// File Paths
|
||||||
export const PROJECT_ROOT = join(__dirname, '../..');
|
export const PROJECT_ROOT = join(__dirname, '../..');
|
||||||
@ -24,7 +26,9 @@ export const DIST_ROOT = join(PROJECT_ROOT, DIST_NAME);
|
|||||||
export const DIST_E2E_ROOT = join(DIST_ROOT, E2E_NAME);
|
export const DIST_E2E_ROOT = join(DIST_ROOT, E2E_NAME);
|
||||||
export const DIST_E2E_COMPONENTS_ROOT = join(DIST_E2E_ROOT, COMPONENTS_NAME);
|
export const DIST_E2E_COMPONENTS_ROOT = join(DIST_E2E_ROOT, COMPONENTS_NAME);
|
||||||
export const DIST_BUILD_ROOT = join(DIST_ROOT, PACKAGE_NAME);
|
export const DIST_BUILD_ROOT = join(DIST_ROOT, PACKAGE_NAME);
|
||||||
|
export const DIST_BUNDLE_ROOT = join(DIST_BUILD_ROOT, BUNDLES);
|
||||||
export const DIST_BUILD_UMD_ROOT = join(DIST_BUILD_ROOT, UMD_MODULE);
|
export const DIST_BUILD_UMD_ROOT = join(DIST_BUILD_ROOT, UMD_MODULE);
|
||||||
|
export const DIST_BUILD_UMD_BUNDLE_ENTRYPOINT = join(DIST_BUILD_ROOT, INDEX_JS);
|
||||||
export const DIST_BUILD_ES2015_ROOT = join(DIST_BUILD_ROOT, ES_2015);
|
export const DIST_BUILD_ES2015_ROOT = join(DIST_BUILD_ROOT, ES_2015);
|
||||||
export const DIST_VENDOR_ROOT = join(DIST_ROOT, VENDOR_NAME);
|
export const DIST_VENDOR_ROOT = join(DIST_ROOT, VENDOR_NAME);
|
||||||
export const NODE_MODULES_ROOT = join(PROJECT_ROOT, NODE_MODULES);
|
export const NODE_MODULES_ROOT = join(PROJECT_ROOT, NODE_MODULES);
|
||||||
|
@ -2,9 +2,12 @@ import { spawn, exec } from 'child_process';
|
|||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
|
|
||||||
import { dest, src, task } from 'gulp';
|
import { dest, src, task } from 'gulp';
|
||||||
|
import { rollup } from 'rollup';
|
||||||
|
import * as commonjs from 'rollup-plugin-commonjs';
|
||||||
|
import * as nodeResolve from 'rollup-plugin-node-resolve';
|
||||||
import * as runSequence from 'run-sequence';
|
import * as runSequence from 'run-sequence';
|
||||||
|
|
||||||
import { DIST_BUILD_ROOT, SCRIPTS_ROOT, SRC_ROOT, PROJECT_ROOT } from '../constants';
|
import { DIST_BUILD_UMD_BUNDLE_ENTRYPOINT, DIST_BUILD_ROOT, DIST_BUNDLE_ROOT, PROJECT_ROOT, SCRIPTS_ROOT, SRC_ROOT } from '../constants';
|
||||||
import { compileSass, copyFonts, createTimestamp, setSassIonicVersion, writePolyfills } from '../util';
|
import { compileSass, copyFonts, createTimestamp, setSassIonicVersion, writePolyfills } from '../util';
|
||||||
|
|
||||||
|
|
||||||
@ -13,11 +16,31 @@ task('nightly', (done: (err: any) => void) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
task('release.prepareNightly', (done: (err: any) => void) => {
|
task('release.prepareNightly', (done: (err: any) => void) => {
|
||||||
runSequence('release.pullLatest', 'validate', 'release.copyTemplates', 'release.copyNpmInfo', 'release.preparePackageJsonTemplate', 'release.nightlyPackageJson', done);
|
runSequence(/*'release.pullLatest', 'validate',*/ 'release.copyTemplates', 'release.copyNpmInfo', 'release.preparePackageJsonTemplate', 'release.nightlyPackageJson', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
task('release.nightlyPackage', (done: (err: any) => void) => {
|
task('release.nightlyPackage', (done: (err: any) => void) => {
|
||||||
runSequence('clean', 'release.polyfill', 'compile.release', 'release.prepareNightly', 'release.compileSass', 'release.fonts', 'release.scss', done);
|
runSequence('clean', 'release.polyfill', 'compile.release', 'release.prepareNightly', 'release.compileSass', 'release.fonts', 'release.scss', 'release.createUmdBundle', done);
|
||||||
|
});
|
||||||
|
|
||||||
|
task('release.createUmdBundle', (done: Function) => {
|
||||||
|
return rollup({
|
||||||
|
entry: DIST_BUILD_UMD_BUNDLE_ENTRYPOINT,
|
||||||
|
plugins: [
|
||||||
|
nodeResolve({
|
||||||
|
module: true,
|
||||||
|
jsnext: true,
|
||||||
|
main: true
|
||||||
|
}),
|
||||||
|
commonjs()
|
||||||
|
]
|
||||||
|
}).then((bundle) => {
|
||||||
|
return bundle.write({
|
||||||
|
format: 'umd',
|
||||||
|
moduleName: 'umd-bundle',
|
||||||
|
dest: `${DIST_BUNDLE_ROOT}/ionic.umd.js`
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
task('release.polyfill', (done: Function) => {
|
task('release.polyfill', (done: Function) => {
|
||||||
|
Reference in New Issue
Block a user