Reference: https://github.com/mgechev/angular-seed
I need help with the following question: I have a custom asset structure to I decided to format and separate my file types by folder:
/img
/scss
/ts
/fonts
So I had to change in seed.config.ts the path names:
ASSETS_SRC = `${this.APP_SRC}/assets`;
/**
* The folder of the applications img files.
* @type {string}
*/
IMG_SRC = `${this.ASSETS_SRC}/img`;
/**
* The folder of the applications ts files.
* @type {string}
*/
TS_SRC = `${this.ASSETS_SRC}/ts`;
/**
* The folder of the applications fonts files.
* @type {string}
*/
FONT_SRC = `${this.ASSETS_SRC}/fonts`;
I wanted to know if under tasks/project folder for a new task I have to call it the same name as the original task "build.assets.dev.ts, build.assets.prod.ts" to overwrite it and add it to tasks/project folder?
Like so:
import * as gulp from 'gulp';
import { join } from 'path';
import { AssetsTask } from '../assets_task';
import Config from '../../config';
/**
* Executes the build process, copying the assets located in `src/client` over to the appropriate
* `dist/dev` directory.
*/
export =
class BuildAssetsTask extends AssetsTask {
run(done: any) {
let paths: string[] = [
join(Config.APP_SRC, '**'),
join(Config.NPM_BASE, '@angular', 'service-worker', 'bundles', 'worker-basic.js'),
'!' + join(Config.TS_SRC, '**', '*.ts'),
'!' + join(Config.SCSS_SRC, '**', '*.scss'),
'!' + join(Config.IMG_SRC, '**', '*.jpg|png|gif|svg|jpeg'),
'!' + join(Config.FONT_SRC, '**', '*.eot|woff|otf|ttf'),
].concat(Config.TEMP_FILES.map((p) => { return '!' + p; }));
return gulp.src(paths)
.pipe(gulp.dest(Config.APP_DEST));
}
};