Skip to content

Commit

Permalink
Merge pull request #457 from Robert-Frampton/bootstrapsource
Browse files Browse the repository at this point in the history
Run npm compile script
  • Loading branch information
jbalsas authored Jan 24, 2018
2 parents d3b3d4b + 962b928 commit 896d452
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 5 deletions.
45 changes: 44 additions & 1 deletion packages/clay/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var filter = require('gulp-filter');
var gulp = require('gulp-help')(require('gulp'));
var path = require('path');
var plugins = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
Expand All @@ -11,6 +12,8 @@ var config = {
SRC_GLOB: 'src/**/*'
};

var bootstrapPath = path.dirname(require.resolve('bootstrap/package.json'));

var license = require('./tasks/copyright_banner');
var tasks = require('require-dir')('./tasks');

Expand Down Expand Up @@ -38,6 +41,9 @@ gulp.task(
runSequence(
'compile:clean',
'compile:files',
'compile:bootstrap:js',
'compile:bootstrap:scss',
'compile:popper',
'build:svg:scss-icons',
'compile:prep-scss',
'compile:css',
Expand All @@ -50,6 +56,27 @@ gulp.task(
}
);

gulp.task(
'compile:bootstrap:js',
function() {
var src = [
path.join(bootstrapPath, 'dist/js/bootstrap.js'),
path.join(bootstrapPath, 'dist/js/bootstrap.js.map')
];

return gulp.src(src)
.pipe(gulp.dest('./src/js'));
}
);

gulp.task(
'compile:bootstrap:scss',
function() {
return gulp.src(path.join(bootstrapPath, 'scss/**/*'))
.pipe(gulp.dest('./src/scss/bootstrap'));
}
);

gulp.task(
'compile:files',
function(cb) {
Expand All @@ -60,7 +87,8 @@ gulp.task(
var src = [
'src/fonts/**/*',
'src/images/icons/*',
'src/js/{,bootstrap/}*.js'
'src/js/{,bootstrap/}*.js',
'src/js/{,bootstrap/}*.js.map'
];

return gulp.src(src, {
Expand Down Expand Up @@ -104,6 +132,21 @@ gulp.task(
}
);

gulp.task(
'compile:popper',
function() {
var popperPath = path.dirname(require.resolve('popper.js/package.json'));

var src = [
path.join(popperPath, 'dist/umd/popper.js'),
path.join(popperPath, 'dist/umd/popper.js.map')
];

return gulp.src(src)
.pipe(gulp.dest('./src/js'));
}
);

gulp.task(
'compile:prep-scss',
function() {
Expand Down
2 changes: 2 additions & 0 deletions packages/clay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"license": "MIT",
"devDependencies": {
"basename": "^0.1.2",
"bootstrap": "4.0.0",
"browser-sync": "^2.14.0",
"cheerio": "^0.20.0",
"ejs": "^2.3.1",
Expand Down Expand Up @@ -82,6 +83,7 @@
"metalsmith-permalinks": "^0.4.0",
"metalsmith-sass": "^1.2.1",
"metalsmith-templates": "^0.7.0",
"popper.js": "1.12.9",
"require-dir": "^0.3.0",
"run-sequence": "^1.1.1",
"string-sub": "0.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/clay/src/js/bootstrap.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions packages/clay/src/js/popper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/clay/src/js/popper.js.map

Large diffs are not rendered by default.

0 comments on commit 896d452

Please sign in to comment.