19 lines
572 B
JavaScript
19 lines
572 B
JavaScript
// Post-build step: build-figma-plugin strips unknown manifest fields
|
|
// (networkAccess), so re-inject it after every build.
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const file = path.join(__dirname, 'manifest.json')
|
|
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
|
|
manifest.networkAccess = {
|
|
allowedDomains: [
|
|
'https://api.apinex.bond',
|
|
'https://apinex.bond',
|
|
'https://example.com'
|
|
]
|
|
}
|
|
|
|
fs.writeFileSync(file, JSON.stringify(manifest, null, 2) + '\n')
|
|
console.log('[inject-manifest] networkAccess re-injected into manifest.json')
|