forked from akveo/nebular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(package): optimize gulp config, integrate a rollup
- Loading branch information
Alexander Zhukov
committed
Apr 26, 2017
1 parent
9116238
commit 8a726d3
Showing
26 changed files
with
253 additions
and
1,278 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,6 +1,8 @@ | ||
# compiled output | ||
/dist | ||
/tmp | ||
/compiled | ||
/build | ||
|
||
# dependencies | ||
node_modules | ||
|
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,14 +1,43 @@ | ||
'use strict'; | ||
/** | ||
* Load the TypeScript compiler, then load the TypeScript gulpfile which simply loads all | ||
* the tasks. The tasks are really inside tools/gulp/tasks. | ||
*/ | ||
var gulp = require('gulp'); | ||
var sass = require('gulp-sass'); | ||
var replace = require('gulp-replace'); | ||
var autoprefixer = require('gulp-autoprefixer'); | ||
var sourcemaps = require('gulp-sourcemaps'); | ||
var cleanCSS = require('gulp-clean-css'); | ||
|
||
const path = require('path'); | ||
var inlineResources = require('./scripts/inline-resources'); | ||
|
||
// Register TS compilation | ||
require('ts-node').register({ | ||
project: path.join(__dirname, 'tools/gulp') | ||
}); | ||
gulp.task('start', copySources); | ||
|
||
require('./tools/gulp/gulpfile'); | ||
function copySources() { | ||
gulp.src('./src/framework/**/*') | ||
.pipe(gulp.dest('./build')) | ||
.on('end', fixStyleUrl); | ||
} | ||
|
||
function fixStyleUrl() { | ||
gulp.src(['./build/**/*.ts']) | ||
.pipe(replace('.scss', '.css')) | ||
.pipe(gulp.dest('./build')) | ||
.on('end', autoprefixSass); | ||
} | ||
|
||
function autoprefixSass() { | ||
gulp.src(['./build/**/*.component.scss', './build/**/*.component.theme.scss']) | ||
.pipe(autoprefixer({ | ||
browsers: ['last 2 versions'] | ||
})) | ||
.pipe(gulp.dest('./build')) | ||
.on('end', compileSass); | ||
} | ||
|
||
function compileSass() { | ||
gulp.src('./build/**/*.component.scss') | ||
.pipe(sass({ | ||
outputStyle: 'compressed' | ||
})) | ||
.pipe(cleanCSS()) | ||
.pipe(gulp.dest('./build')); | ||
} | ||
|
||
gulp.task('default', ['start']); |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -48,6 +48,8 @@ | |
} | ||
} | ||
|
||
|
||
|
||
ul > li.arrow { | ||
border-bottom: 11px solid $nga-user-menu-border !important; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
Empty file.
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,47 @@ | ||
export const ROLLUP_GLOBALS = { | ||
// Angular dependencies | ||
'@angular/animations': 'ng.animations', | ||
'@angular/core': 'ng.core', | ||
'@angular/common': 'ng.common', | ||
'@angular/forms': 'ng.forms', | ||
'@angular/http': 'ng.http', | ||
'@angular/platform-browser': 'ng.platformBrowser', | ||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', | ||
'@angular/platform-browser/animations': 'ng.platformBrowser.animations', | ||
'@angular/platform-server': 'ng.platformServer', | ||
|
||
// Rxjs dependencies | ||
'rxjs/Subject': 'Rx', | ||
'rxjs/add/observable/fromEvent': 'Rx.Observable', | ||
'rxjs/add/observable/forkJoin': 'Rx.Observable', | ||
'rxjs/add/observable/of': 'Rx.Observable', | ||
'rxjs/add/observable/merge': 'Rx.Observable', | ||
'rxjs/add/observable/throw': 'Rx.Observable', | ||
'rxjs/add/operator/auditTime': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/toPromise': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/map': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/filter': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/do': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/share': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/finally': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/catch': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/first': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/startWith': 'Rx.Observable.prototype', | ||
'rxjs/add/operator/switchMap': 'Rx.Observable.prototype', | ||
'rxjs/Observable': 'Rx', | ||
}; | ||
|
||
export const BUILD_CONFIG = { | ||
sourceMap: false, | ||
format: 'umd', | ||
} | ||
|
||
export function getLicenseBanner(libName, pjsonPath) { | ||
const libVersion = require(pjsonPath).version; | ||
|
||
return `/** | ||
* @license ${libName} v${libVersion} | ||
* Copyright (c) 2017 Akveo. https://github.com/akveo/ng2-admin/tree/ngx-admin/ | ||
* License: MIT | ||
*/`; | ||
} |
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 @@ | ||
import { | ||
ROLLUP_GLOBALS, | ||
BUILD_CONFIG, | ||
getLicenseBanner, | ||
} from './rollup.config.common'; | ||
|
||
const globals = Object.assign({}, ROLLUP_GLOBALS, { | ||
'immutable': 'immutable', | ||
}); | ||
|
||
const banner = getLicenseBanner('@nga/theme', '../../src/framework/theme/package.json'); | ||
|
||
export default { | ||
...Object.assign({}, BUILD_CONFIG, { | ||
external: Object.keys(globals), | ||
globals, | ||
moduleName: 'nga.theme', | ||
entry: 'dist/theme/index.js', | ||
dest: 'dist/theme/bundles/theme.umd.js', | ||
banner, | ||
}), | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.