mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
[NewUI] Build mascara with uglification and gzipping. (#2735)
* Adds uglification and gzipping. * Build mascara with uglification and gzipping. * Remove gzipping from extension build.
This commit is contained in:
parent
b8310ac62e
commit
41057a76c5
@ -23,6 +23,8 @@ var sass = require('gulp-sass')
|
|||||||
var autoprefixer = require('gulp-autoprefixer')
|
var autoprefixer = require('gulp-autoprefixer')
|
||||||
var gulpStylelint = require('gulp-stylelint')
|
var gulpStylelint = require('gulp-stylelint')
|
||||||
var stylefmt = require('gulp-stylefmt')
|
var stylefmt = require('gulp-stylefmt')
|
||||||
|
var uglify = require('gulp-uglify')
|
||||||
|
var babel = require('gulp-babel')
|
||||||
|
|
||||||
|
|
||||||
var disableDebugTools = gutil.env.disableDebugTools
|
var disableDebugTools = gutil.env.disableDebugTools
|
||||||
@ -375,6 +377,11 @@ function bundleTask(opts) {
|
|||||||
// sourcemaps
|
// sourcemaps
|
||||||
// loads map from browserify file
|
// loads map from browserify file
|
||||||
.pipe(gulpif(debug, sourcemaps.init({ loadMaps: true })))
|
.pipe(gulpif(debug, sourcemaps.init({ loadMaps: true })))
|
||||||
|
// Minification
|
||||||
|
.pipe(babel({
|
||||||
|
presets: ['env']
|
||||||
|
}))
|
||||||
|
.pipe(uglify())
|
||||||
// writes .map file
|
// writes .map file
|
||||||
.pipe(gulpif(debug, sourcemaps.write('./')))
|
.pipe(gulpif(debug, sourcemaps.write('./')))
|
||||||
// write completed bundles
|
// write completed bundles
|
||||||
|
@ -2,6 +2,7 @@ const path = require('path')
|
|||||||
const express = require('express')
|
const express = require('express')
|
||||||
const createBundle = require('./util').createBundle
|
const createBundle = require('./util').createBundle
|
||||||
const serveBundle = require('./util').serveBundle
|
const serveBundle = require('./util').serveBundle
|
||||||
|
const compression = require('compression')
|
||||||
|
|
||||||
module.exports = createMetamascaraServer
|
module.exports = createMetamascaraServer
|
||||||
|
|
||||||
@ -16,6 +17,8 @@ function createMetamascaraServer () {
|
|||||||
|
|
||||||
// serve bundles
|
// serve bundles
|
||||||
const server = express()
|
const server = express()
|
||||||
|
server.use(compression())
|
||||||
|
|
||||||
// ui window
|
// ui window
|
||||||
serveBundle(server, '/ui.js', uiBundle)
|
serveBundle(server, '/ui.js', uiBundle)
|
||||||
server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))
|
server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))
|
||||||
|
@ -23,7 +23,9 @@ function createBundle (entryPoint) {
|
|||||||
cache: {},
|
cache: {},
|
||||||
packageCache: {},
|
packageCache: {},
|
||||||
plugin: [watchify],
|
plugin: [watchify],
|
||||||
}).transform('babelify')
|
})
|
||||||
|
.transform('babelify')
|
||||||
|
.transform('uglifyify', { global: true })
|
||||||
|
|
||||||
bundler.on('update', bundle)
|
bundler.on('update', bundle)
|
||||||
bundle()
|
bundle()
|
||||||
|
@ -199,6 +199,7 @@
|
|||||||
"eth-json-rpc-middleware": "^1.2.7",
|
"eth-json-rpc-middleware": "^1.2.7",
|
||||||
"fs-promise": "^2.0.3",
|
"fs-promise": "^2.0.3",
|
||||||
"gulp": "github:gulpjs/gulp#4.0",
|
"gulp": "github:gulpjs/gulp#4.0",
|
||||||
|
"gulp-babel": "^7.0.0",
|
||||||
"gulp-if": "^2.0.1",
|
"gulp-if": "^2.0.1",
|
||||||
"gulp-json-editor": "^2.2.1",
|
"gulp-json-editor": "^2.2.1",
|
||||||
"gulp-livereload": "^3.8.1",
|
"gulp-livereload": "^3.8.1",
|
||||||
@ -206,6 +207,7 @@
|
|||||||
"gulp-sourcemaps": "^2.6.0",
|
"gulp-sourcemaps": "^2.6.0",
|
||||||
"gulp-stylefmt": "^1.1.0",
|
"gulp-stylefmt": "^1.1.0",
|
||||||
"gulp-stylelint": "^4.0.0",
|
"gulp-stylelint": "^4.0.0",
|
||||||
|
"gulp-uglify": "^3.0.0",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
"gulp-watch": "^4.3.5",
|
"gulp-watch": "^4.3.5",
|
||||||
"gulp-zip": "^4.0.0",
|
"gulp-zip": "^4.0.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user