Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix build to output index at root (#121)
Browse files Browse the repository at this point in the history
* fix(build): clean up guld file

* feat(build): fix build to output the index and folders at the root level
  • Loading branch information
joshuawilson authored and corinnekrych committed Aug 27, 2018
1 parent 70d377e commit ec30a39
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 85 deletions.
31 changes: 10 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

const gulp = require('gulp'),
autoprefixer = require('autoprefixer'),
LessAutoprefix = require('less-plugin-autoprefix'),
autoprefix = new LessAutoprefix({ browsers: ['last 2 versions'] }),
changed = require('gulp-changed'),
cssmin = require('gulp-cssmin'),
del = require('del'),
Expand All @@ -16,17 +14,16 @@ const gulp = require('gulp'),
postcss = require('postcss'),
replace = require('gulp-replace'),
rename = require('gulp-rename');
runSequence = require('run-sequence'),
sourcemaps = require('gulp-sourcemaps'),
stylelint = require('gulp-stylelint'),
stylus = require('stylus');

var appSrc = 'src';
var libraryBuild = 'build';
var libraryDist = 'dist';
var demoDist = 'dist-demo';
var watchDist = 'dist-watch';
var globalExcludes = [
const appSrc = 'src';
const libraryBuild = 'build';
const libraryDist = 'dist';
const demoDist = 'dist-demo';
const watchDist = 'dist-watch';
const globalExcludes = [
'!./**/demo.*',
'!./**/demo/**',
'!./**/example',
Expand Down Expand Up @@ -72,7 +69,7 @@ function copyToDist(srcArr) {
// Minify HTML templates
function minifyTemplate(file) {
try {
var minifiedFile = htmlMinifier.minify(file, {
let minifiedFile = htmlMinifier.minify(file, {
collapseWhitespace: true,
caseSensitive: true,
removeComments: true
Expand All @@ -83,13 +80,6 @@ function minifyTemplate(file) {
}
}

function updateWatchDist() {
return gulp
.src([libraryDist + '/**'].concat(globalExcludes))
.pipe(changed(watchDist))
.pipe(gulp.dest(watchDist));
}

// Build LESS
function transpileLESS(src) {
return gulp.src(src)
Expand All @@ -115,7 +105,6 @@ function transpileMinifyLESS(src) {
}))
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write())
// .pipe(gulp.dest('./dist/src/'));
.pipe(gulp.dest(function (file) {
return __dirname + file.base.slice(__dirname.length);
}));
Expand Down Expand Up @@ -187,9 +176,9 @@ function transpileLess() {
function inlineTemplate() {
return gulp.src(['./src/app/**/*.ts'].concat(globalExcludes), {base: './'})
.pipe(replace(/templateUrl.*\'/g, function (matched) {
var fileName = matched.match(/\/.*html/g).toString();
var dirName = this.file.relative.substring(0, this.file.relative.lastIndexOf('/'));
var fileContent = fs.readFileSync(dirName + fileName, "utf8");
let fileName = matched.match(/\/.*html/g).toString();
let dirName = this.file.relative.substring(0, this.file.relative.lastIndexOf('/'));
let fileContent = fs.readFileSync(dirName + fileName, "utf8");
return 'template: \`' + minifyTemplate(fileContent) + '\`';
}))
.pipe(gulp.dest(libraryBuild));
Expand Down
19 changes: 9 additions & 10 deletions tsconfig-aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,34 @@
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"baseUrl": ".",
"rootDir": "build/src",
"outDir": "build-aot",
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"inlineSources": true,
"lib": [ "dom", "es6" ],
"module": "es2015",
"moduleResolution": "node",
"noEmitHelpers": false, // Planner and demo won't run when true
"noImplicitAny": true,
"noStrictGenericChecks": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"outDir": "build-aot",
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/common": ["node_modules/@angular/common"],
"@angular/forms": ["node_modules/@angular/forms"],
"moment": ["node_modules/moment"],
"@angular/http": ["node_modules/@angular/http"],
"@angular/router": ["node_modules/@angular/router"],
"rxjs/*": ["node_modules/rxjs/*"]
},
"rootDir": "build/src/app",
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": false,
"stripInternal": true
"stripInternal": true,
"target": "es5"
},
"exclude": [
"node_modules",
Expand Down
54 changes: 25 additions & 29 deletions tsconfig-test.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
{
"angularCompilerOptions": {
"genDir": "compiled",
"skipTemplateCodegen": true,
"strictMetadataEmit": true
},
"atom": { "rewriteTsconfig": false },
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"skipLibCheck": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"inlineSources": true,
"lib": [ "dom", "es6" ],
"module": "es2015",
"moduleResolution": "node",
"noEmitHelpers": false, // Planner and demo won't run when true
"strictNullChecks": false,
"noImplicitAny": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"rootDir": ".",
"outDir": "dist",
"noEmit": true,
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/common": ["node_modules/@angular/common"],
"@angular/forms": ["node_modules/@angular/forms"],
"rxjs/*": ["node_modules/rxjs/*"],
"moment": ["node_modules/moment"]
"@angular/http": ["node_modules/@angular/http"],
"@angular/router": ["node_modules/@angular/router"],
"rxjs/*": ["node_modules/rxjs/*"]
},
"lib": [
"es2015",
"dom"
]
"rootDir": "build/src/app",
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": false,
"stripInternal": true,
"target": "es5"
},
"files": [
"app/src/index.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
"genDir": "compiled"
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
"build/src/app/index.ts"
]
}
47 changes: 22 additions & 25 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
{
"angularCompilerOptions": {
"genDir": "compiled",
"skipTemplateCodegen": true,
"strictMetadataEmit": true
},
"atom": { "rewriteTsconfig": false },
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
"target": "es5",
"module": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"skipLibCheck": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"inlineSources": true,
"noEmitHelpers": false,
"strictNullChecks": false,
"lib": [ "dom", "es6" ],
"module": "es2015",
"moduleResolution": "node",
"noEmitHelpers": false, // Planner and demo won't run when true
"noImplicitAny": true,
"baseUrl": ".",
"rootDir": ".",
"outDir": "dist",
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/http": ["node_modules/@angular/http"],
"@angular/router": ["node_modules/@angular/router"],
"rxjs/*": ["node_modules/rxjs/*"]
},
"lib": [
"es2015",
"dom"
]
"rootDir": "build/src/app",
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": false,
"stripInternal": true,
"target": "es5"
},
"files": [
"src/app/index.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
"genDir": "compiled"
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
"build/src/app/index.ts"
]
}

0 comments on commit ec30a39

Please sign in to comment.