mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
33 lines
977 B
JavaScript
33 lines
977 B
JavaScript
|
const express = require('express')
|
||
|
const createBundle = require('./util').createBundle
|
||
|
const serveBundle = require('./util').serveBundle
|
||
|
|
||
|
module.exports = createMetamascaraServer
|
||
|
|
||
|
|
||
|
function createMetamascaraServer(){
|
||
|
|
||
|
// start bundlers
|
||
|
const metamascaraBundle = createBundle('./src/mascara.js')
|
||
|
const proxyBundle = createBundle('./src/proxy.js')
|
||
|
const uiBundle = createBundle('./src/popup.js')
|
||
|
const backgroundBuild = createBundle('./src/background.js')
|
||
|
|
||
|
// serve bundles
|
||
|
const server = express()
|
||
|
// ui window
|
||
|
serveBundle(server, '/ui.js', uiBundle)
|
||
|
server.use(express.static(__dirname+'/../ui/'))
|
||
|
server.use(express.static(__dirname+'/../../dist/chrome'))
|
||
|
// metamascara
|
||
|
serveBundle(server, '/metamascara.js', metamascaraBundle)
|
||
|
// proxy
|
||
|
serveBundle(server, '/proxy/proxy.js', proxyBundle)
|
||
|
server.use('/proxy/', express.static(__dirname+'/../proxy'))
|
||
|
// background
|
||
|
serveBundle(server, '/background.js', backgroundBuild)
|
||
|
|
||
|
return server
|
||
|
|
||
|
}
|