safari assets folder and gulp task
19
gulpfile.js
@@ -27,7 +27,7 @@ const filters = {
|
|||||||
'build/popup/fonts/fontawesome*.woff'
|
'build/popup/fonts/fontawesome*.woff'
|
||||||
],
|
],
|
||||||
safari: [
|
safari: [
|
||||||
'!build/Info.plist',
|
'!build/safari/**/*',
|
||||||
'!build/downloader/**/*'
|
'!build/downloader/**/*'
|
||||||
],
|
],
|
||||||
webExt: [
|
webExt: [
|
||||||
@@ -162,9 +162,12 @@ gulp.task('ci:coverage', (cb) => {
|
|||||||
|
|
||||||
gulp.task('safari:build', (cb) => {
|
gulp.task('safari:build', (cb) => {
|
||||||
const buildPath = './build.safariextension/';
|
const buildPath = './build.safariextension/';
|
||||||
|
const safariAssetsBuildPath = buildPath + 'safari/';
|
||||||
|
|
||||||
return del([buildPath + '**/*'])
|
return del([buildPath + '**/*'])
|
||||||
.then(() => safariMoveBuild(paths.build + '**/*', buildPath))
|
.then(() => safariCopyBuild(paths.build + '**/*', buildPath))
|
||||||
|
.then(() => copy(safariAssetsBuildPath + '**/*', buildPath))
|
||||||
|
.then(() => del([safariAssetsBuildPath]))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return cb;
|
return cb;
|
||||||
}, () => {
|
}, () => {
|
||||||
@@ -172,11 +175,21 @@ gulp.task('safari:build', (cb) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function safariMoveBuild(source, dest) {
|
function safariCopyBuild(source, dest) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
gulp.src(source)
|
gulp.src(source)
|
||||||
.on('error', reject)
|
.on('error', reject)
|
||||||
.pipe(filter(['**'].concat(filters.edge).concat(filters.fonts).concat(filters.webExt)))
|
.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))
|
.pipe(gulp.dest(dest))
|
||||||
.on('end', resolve);
|
.on('end', resolve);
|
||||||
});
|
});
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
src/safari/Icon-128.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/safari/Icon-32.png
Normal file
|
After Width: | Height: | Size: 749 B |
BIN
src/safari/Icon-48.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
src/safari/Icon-96.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -102,9 +102,9 @@ module.exports = {
|
|||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
'./src/manifest.json',
|
'./src/manifest.json',
|
||||||
'./src/Info.plist',
|
|
||||||
{ from: './src/_locales', to: '_locales' },
|
{ from: './src/_locales', to: '_locales' },
|
||||||
{ from: './src/edge', to: 'edge' },
|
{ from: './src/edge', to: 'edge' },
|
||||||
|
{ from: './src/safari', to: 'safari' },
|
||||||
{ from: './src/images', to: 'images' },
|
{ from: './src/images', to: 'images' },
|
||||||
{ from: './src/content/autofill.css', to: 'content' }
|
{ from: './src/content/autofill.css', to: 'content' }
|
||||||
])
|
])
|
||||||
|
|||||||