safari assets folder and gulp task

This commit is contained in:
Kyle Spearrin 2018-01-16 09:41:59 -05:00
parent f0dc6db06c
commit ea7f6a404b
9 changed files with 17 additions and 4 deletions

View File

@ -27,7 +27,7 @@ const filters = {
'build/popup/fonts/fontawesome*.woff'
],
safari: [
'!build/Info.plist',
'!build/safari/**/*',
'!build/downloader/**/*'
],
webExt: [
@ -162,9 +162,12 @@ gulp.task('ci:coverage', (cb) => {
gulp.task('safari:build', (cb) => {
const buildPath = './build.safariextension/';
const safariAssetsBuildPath = buildPath + 'safari/';
return del([buildPath + '**/*'])
.then(() => safariMoveBuild(paths.build + '**/*', buildPath))
.then(() => safariCopyBuild(paths.build + '**/*', buildPath))
.then(() => copy(safariAssetsBuildPath + '**/*', buildPath))
.then(() => del([safariAssetsBuildPath]))
.then(() => {
return cb;
}, () => {
@ -172,11 +175,21 @@ gulp.task('safari:build', (cb) => {
});
});
function safariMoveBuild(source, dest) {
function safariCopyBuild(source, dest) {
return new Promise((resolve, reject) => {
gulp.src(source)
.on('error', reject)
.pipe(filter(['**'].concat(filters.edge).concat(filters.fonts).concat(filters.webExt)))
.pipe(gulpif('popup/index.html', replace('__BROWSER__', 'safari')))
.pipe(gulp.dest(dest))
.on('end', resolve);
});
}
function copy(source, dest) {
return new Promise((resolve, reject) => {
gulp.src(source)
.on('error', reject)
.pipe(gulp.dest(dest))
.on('end', resolve);
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/safari/Icon-128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/safari/Icon-32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

BIN
src/safari/Icon-48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/safari/Icon-96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -102,9 +102,9 @@ module.exports = {
}),
new CopyWebpackPlugin([
'./src/manifest.json',
'./src/Info.plist',
{ from: './src/_locales', to: '_locales' },
{ from: './src/edge', to: 'edge' },
{ from: './src/safari', to: 'safari' },
{ from: './src/images', to: 'images' },
{ from: './src/content/autofill.css', to: 'content' }
])