1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Optimize images only during production build (#7194)

* Optimize images only during production build

Image optimization is fairly slow (over a minute), and isn't necessary
for test or development builds. It is now only run as part of the
`build` gulp task, which is used during `gulp dist`.

* Remove unused gulp tasks

There were two high-level tasks and one style formatting task that
were not used by any npm scripts, so were probably unused generally.

The `dev` task was a duplcate of `dev:extension`. The `build:extension`
task was useful for just building the extension without performing
other steps required by the final production bundle, but it was
broken. It didn't correctly build the ui-libs and bg-libs required.
Instead of fixing it, it has been removed until the handling of those
separate library bundles is simplified.

The style formatting task seems like it could be useful, but I'm unsure
about keeping it around as opt-in, as in practice it'll just end up
being ignored. Moreover the library authors themselves are recommending
switching to `prettier`, so I think we're better off removing it for
now, then considering using `prettier` if we want to introduce
something like this again.

The stylelint dependency was added because it's a peer dependency of
gulp-stylelint that should have already been listed among our
dependencies. It hadn't caused a problem before because it happened to
be a transitive dependency of gulp-stylefmt, which is no longer needed
 and has been removed.
This commit is contained in:
Mark Stacey 2019-09-21 13:32:17 -03:00 committed by GitHub
parent b0ec610908
commit e44a2283b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 617 additions and 537 deletions

View File

@ -16,7 +16,6 @@ const manifest = require('./app/manifest.json')
const sass = require('gulp-sass') const sass = require('gulp-sass')
const autoprefixer = require('gulp-autoprefixer') const autoprefixer = require('gulp-autoprefixer')
const gulpStylelint = require('gulp-stylelint') const gulpStylelint = require('gulp-stylelint')
const stylefmt = require('gulp-stylefmt')
const terser = require('gulp-terser-js') const terser = require('gulp-terser-js')
const pify = require('pify') const pify = require('pify')
const rtlcss = require('gulp-rtlcss') const rtlcss = require('gulp-rtlcss')
@ -357,12 +356,6 @@ gulp.task('lint-scss', function () {
})) }))
}) })
gulp.task('fmt-scss', function () {
return gulp.src('ui/app/css/itcss/**/*.scss')
.pipe(stylefmt())
.pipe(gulp.dest('ui/app/css/itcss'))
})
// build js // build js
const buildJsFiles = [ const buildJsFiles = [
@ -454,18 +447,6 @@ gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:opera'))
// high level tasks // high level tasks
gulp.task('dev',
gulp.series(
'clean',
'dev:scss',
gulp.parallel(
'dev:extension:js',
'dev:copy',
'dev:reload'
)
)
)
gulp.task('dev:test', gulp.task('dev:test',
gulp.series( gulp.series(
'clean', 'clean',
@ -514,23 +495,10 @@ gulp.task('build:test',
'build:test:extension:js', 'build:test:extension:js',
'copy' 'copy'
), ),
'optimize:images',
'manifest:testing' 'manifest:testing'
) )
) )
gulp.task('build:extension',
gulp.series(
'clean',
'build:scss',
gulp.parallel(
'build:extension:js',
'copy'
),
'optimize:images'
)
)
gulp.task('dist', gulp.task('dist',
gulp.series( gulp.series(
'build', 'build',

View File

@ -233,7 +233,6 @@
"gulp-rtlcss": "^1.4.0", "gulp-rtlcss": "^1.4.0",
"gulp-sass": "^4.0.0", "gulp-sass": "^4.0.0",
"gulp-sourcemaps": "^2.6.0", "gulp-sourcemaps": "^2.6.0",
"gulp-stylefmt": "^1.1.0",
"gulp-stylelint": "^7.0.0", "gulp-stylelint": "^7.0.0",
"gulp-terser-js": "^5.0.0", "gulp-terser-js": "^5.0.0",
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
@ -280,6 +279,7 @@
"source-map-explorer": "^2.0.1", "source-map-explorer": "^2.0.1",
"static-server": "^2.2.1", "static-server": "^2.2.1",
"style-loader": "^0.21.0", "style-loader": "^0.21.0",
"stylelint": "^9.10.1",
"stylelint-config-standard": "^18.2.0", "stylelint-config-standard": "^18.2.0",
"tape": "^4.5.1", "tape": "^4.5.1",
"testem": "^2.16.0", "testem": "^2.16.0",

1120
yarn.lock

File diff suppressed because it is too large Load Diff