bundling changes

pull/1425/head
Jamie.Rees 8 years ago
parent 7064afb780
commit 77780900b7

@ -125,11 +125,18 @@ var paths = {
dest: './lib/primeng/'
}
],
sass: { // Simple sass->css compilation
src: ['./Styles/**/*.scss', '!./Styles/primeng/**'],
dest: './css/',
filter: '**/*.css'
},
sass: [ // Simple sass->css compilation
{
src: ['./Styles/**/*.scss', '!./Styles/primeng/**'],
dest: './css/',
filter: '**/*.css'
},
{
src: path.join(wwwroot, 'app/**/*.scss'),
dest: './app/',
filter: '**/*.css'
}
],
bundle: { // This is the config for the bundler, you shouldn't need to change this
root: './',
dest: './lib/bundle.js',
@ -142,6 +149,17 @@ var paths = {
defaultExtension: 'js'
}
},
map: {
text: 'app/text-loader'
},
meta: {
'*.css': {
loader: 'text'
},
'*.html': {
loader: 'text'
}
},
paths: {
'*': 'lib/*',
'app/*': 'app/*'
@ -241,12 +259,18 @@ gulp.task('modules', function () {
})
gulp.task('sass', function () {
return gulp.src(paths.sass.src)
.pipe(changed(paths.sass.dest))
.pipe(gulpif(global.full, sourcemaps.init()))
.pipe(sass({ outputStyle: global.full ? 'compressed' : 'nested' }).on('error', sass.logError))
.pipe(gulpif(global.full, sourcemaps.write('maps')))
.pipe(gulp.dest(path.join(paths.wwwroot, paths.sass.dest)))
var streams = []
for (let module of paths.sass) {
streams.push(
gulp.src(module.src)
.pipe(changed(module.dest, { extension: '.css' }))
.pipe(gulpif(global.full, sourcemaps.init()))
.pipe(sass({ outputStyle: global.full ? 'compressed' : 'nested' }).on('error', sass.logError))
.pipe(gulpif(global.full, sourcemaps.write('maps')))
.pipe(gulp.dest(path.join(paths.wwwroot, module.dest)))
);
}
return merge(streams);
});
@ -262,7 +286,8 @@ gulp.task('bundle', ['typescript_firstrun'], function () {
gulp.task('clean', function () {
return del([
paths.sass.dest + paths.sass.filter,
...paths.npm.src.map(x => path.join(paths.npm.dest, x + "**")),
...paths.sass.map(m => m.filter ? path.join(m.dest, m.filter) : m.dest),
paths.lib.dest,
paths.bundle.dest,
...paths.modules.map(m => m.dest),
@ -307,6 +332,6 @@ gulp.task('publish', callback => runSequence('fullvar', 'full', 'typescript', 'b
// Auto compiles sass files on change, note that this doesn't seem to pick up new files at the moment
gulp.task('watch', function () {
gulp.watch(paths.sass.src, ['sass']);
gulp.watch([].concat(...paths.sass.map(x => typeof (x.src) === "string" ? [x.src] : x.src)), ['sass']);
gulp.watch('./Styles/**/*.css', ['libcss']); // legacy css
});

@ -3,3 +3,14 @@
declare var module: any;
declare var require: any;
declare var localStorage: any;
declare module "*.css" {
let string: string;
export default string;
}
declare module "*.html" {
let string: string;
export default string;
}

@ -7,10 +7,13 @@ import { IdentityService } from './services/identity.service';
import { ICustomizationSettings } from './interfaces/ISettings';
import template from './app.component.html';
@Component({
selector: 'ombi',
moduleId: module.id,
templateUrl: './app.component.html'
templateUrl: template
})
export class AppComponent implements OnInit {

@ -0,0 +1,3 @@
export var translate = function (this: any, load: any) {
return "exports.default = " + JSON.stringify(load.source) + ";";
}

@ -6,7 +6,14 @@ System.config({
defaultExtension: 'js'
}
},
map: { app: '../app' }
map: {
app: '../app',
text: '../app/text-loader'
},
meta: {
'*.css': { loader: 'text' },
'*.html': { loader: 'text' }
}
});
System.import('bundle').then(function () {
System.import('/app/main');

@ -1 +1 @@
{"version":3,"file":"systemjs.config.js","sourceRoot":"","sources":["systemjs.config.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,MAAM,CAAC;IACV,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE;QACN,GAAG,EAAE;YACD,gBAAgB,EAAE,IAAI;SACzB;KACJ;IACD,GAAG,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;CACzB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;IACzB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAA"}
{"version":3,"file":"systemjs.config.js","sourceRoot":"","sources":["systemjs.config.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,MAAM,CAAC;IACV,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE;QACN,GAAG,EAAE;YACD,gBAAgB,EAAE,IAAI;SACzB;KACJ;IACD,GAAG,EAAE;QACD,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,oBAAoB;KAC7B;IACD,IAAI,EAAE;QACF,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;QAC3B,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;KAC/B;CACJ,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;IACzB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAA"}

@ -5,7 +5,14 @@
defaultExtension: 'js'
}
},
map: { app: '../app' }
map: {
app: '../app',
text: '../app/text-loader'
},
meta: {
'*.css': { loader: 'text' },
'*.html': { loader: 'text' }
}
})
System.import('bundle').then(() => {

Loading…
Cancel
Save