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

mascara - server - serve bundles from dist

This commit is contained in:
kumavis 2018-03-29 23:06:01 -07:00
parent 8277c662de
commit 99e618d3f2
3 changed files with 1 additions and 14 deletions

View File

@ -318,7 +318,7 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun
function createTasksForBuildJsMascara({ taskPrefix, devMode, bundleTaskOpts = {} }) {
// inpage must be built before all other scripts:
const rootDir = './mascara/src/'
const buildPhase1 = ['ui', 'proxy', 'background']
const buildPhase1 = ['ui', 'proxy', 'background', 'metamascara']
const destinations = ['./dist/mascara']
bundleTaskOpts = Object.assign({
buildSourceMaps: true,

View File

@ -9,23 +9,10 @@ module.exports = createMetamascaraServer
function createMetamascaraServer () {
// start bundlers
const metamascaraBundle = createBundle(path.join(__dirname, '/../src/mascara.js'))
const proxyBundle = createBundle(path.join(__dirname, '/../src/proxy.js'))
const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js'))
const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js'))
// setup server
const server = express()
server.use(compression())
// serve bundles
serveBundle(server, '/metamascara.js', metamascaraBundle)
serveBundle(server, '/scripts/ui.js', uiBundle)
serveBundle(server, '/scripts/proxy.js', proxyBundle)
// the serviceworker must be served from the root of the app
serveBundle(server, '/background.js', backgroundBuild)
// serve assets
server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))
server.use(express.static(path.join(__dirname, '/../../dist/mascara')))