Skip to content

Commit

Permalink
chore(app-launcher): modified ngx-forge package module to use index.js
Browse files Browse the repository at this point in the history
Fixes: fabric8-launcher#93
Tested via npm link with fabric8-ui.

While the ngx-forge.js bundle is still available, this helps fabric8-ui build performance because Angular isn’t resolving duplicates.
This also means that fabric8-ui can install its own dependencies instead of packages being embedded in the ngx-forge.js bundle.

- Copied HTML and CSS to the correct dist/src/app directories instead of dist/app
- Copied missing images to dist/src/assets
- Modified package.json module to use index.js
- Fixed components with missing HTML and CSS paths
- Moved styleUrls after templateUrl so grunt can properly rename files from “.less” to “.css”
- Removed duplicate trigger attributes to avoid linter attr-no-duplication errors
- bumped package version number for next release
  • Loading branch information
dlabrecq committed Mar 7, 2018
1 parent 37c1c58 commit 19a01fc
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 277 deletions.
14 changes: 11 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var watchDist = 'dist-watch';
function copyToDist(srcArr) {
return gulp.src(srcArr)
.pipe(gulp.dest(function (file) {
return libraryDist + file.base.slice(__dirname.length + 'src/'.length); // save directly to dist
return libraryDist + file.base.slice(__dirname.length); // save directly to dist
}));
}

Expand Down Expand Up @@ -61,7 +61,7 @@ function transpileLESS(src, debug) {
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(function (file) {
return libraryDist + file.base.slice(__dirname.length + 'src/'.length);
return libraryDist + file.base.slice(__dirname.length);
}));
combined.on('error', console.error.bind(console));
return combined;
Expand Down Expand Up @@ -108,7 +108,7 @@ gulp.task('stylelint', function lintLessTask() {
// FIXME: why do we need that?
// replaces templateURL/styleURL with require statements in js.
gulp.task('post-transpile', ['transpile'], function () {
return gulp.src(['dist/app/**/*.js'])
return gulp.src(['dist/src/**/*.js'])
.pipe(replace(/templateUrl:\s/g, "template: require("))
.pipe(replace(/\.html',/g, ".html'),"))
.pipe(replace(/styleUrls: \[/g, "styles: [require("))
Expand Down Expand Up @@ -140,6 +140,13 @@ gulp.task('copy-html', function () {
]);
});

// copies images to libraryDist.
gulp.task('copy-images', function () {
return copyToDist([
'src/assets/images/**/*.*'
]);
});

// require transpile to finish before copying the css
gulp.task('copy-css', ['transpile'], function () {
return copyToDist([
Expand All @@ -163,6 +170,7 @@ gulp.task('build:library',
[
'post-transpile',
'copy-html',
'copy-images',
'bundle',
'copy-static-assets'
]);
Expand Down
Loading

0 comments on commit 19a01fc

Please sign in to comment.