mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
mascara - server - serve bundles from dist
This commit is contained in:
parent
8277c662de
commit
99e618d3f2
@ -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,
|
||||
|
@ -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')))
|
||||
|
Loading…
Reference in New Issue
Block a user