mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
feat(@embark/pipeline): enable choosing which fields to filter out
This commit is contained in:
parent
f9fb302740
commit
b5c81bd41a
@ -52,7 +52,9 @@ module.exports = {
|
|||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// Using filteredFields lets you customize which field you want to filter out of the contract file (requires minimalContractSize: true)
|
||||||
// minimalContractSize: false,
|
// minimalContractSize: false,
|
||||||
|
// filteredFields: [],
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
// example:
|
// example:
|
||||||
|
@ -52,7 +52,9 @@ module.exports = {
|
|||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// Using filteredFields lets you customize which field you want to filter out of the contract file (requires minimalContractSize: true)
|
||||||
// minimalContractSize: false,
|
// minimalContractSize: false,
|
||||||
|
// filteredFields: [],
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
SimpleStorage: {
|
SimpleStorage: {
|
||||||
|
@ -52,7 +52,9 @@ module.exports = {
|
|||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// Using filteredFields lets you customize which field you want to filter out of the contract file (requires minimalContractSize: true)
|
||||||
// minimalContractSize: false,
|
// minimalContractSize: false,
|
||||||
|
// filteredFields: [],
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
// example:
|
// example:
|
||||||
|
@ -343,11 +343,17 @@ class Pipeline {
|
|||||||
async.each(contracts, (contract, eachCb) => {
|
async.each(contracts, (contract, eachCb) => {
|
||||||
if (self.embark.config.contractsConfig.minimalContractSize) {
|
if (self.embark.config.contractsConfig.minimalContractSize) {
|
||||||
contract = Object.assign({}, contract);
|
contract = Object.assign({}, contract);
|
||||||
delete contract.code;
|
|
||||||
delete contract.runtimeBytecode;
|
const filteredFields = self.embark.config.contractsConfig.filteredFields || [
|
||||||
delete contract.realRuntimeBytecode;
|
'code',
|
||||||
delete contract.gasEstimates;
|
'runtimeBytecode',
|
||||||
delete contract.swarmHash;
|
'realRuntimeBytecode',
|
||||||
|
'gasEstimates',
|
||||||
|
'swarmHash'
|
||||||
|
];
|
||||||
|
filteredFields.forEach(filteredField => {
|
||||||
|
delete contract[filteredField];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
self.fs.writeJson(dappPath(
|
self.fs.writeJson(dappPath(
|
||||||
self.buildDir,
|
self.buildDir,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user