safari assets folder and gulp task
19
gulpfile.js
|
@ -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);
|
||||
});
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 749 B |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
|
@ -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' }
|
||||
])
|
||||
|
|