Sunday, 27 May 2018

Replace object with static fields with the values of the fields in webpack

I have a module that looks like this:

let Info = {};

Info.VALUE_ONE = 123;
Info.VALUE_TWO = 456;
Info.VALUE_THREE = 789;

module.exports = Info;

I'd like this module to disappear completely from the code after it's compiled and just have the values 123, 456 and 789 inlined where applicable- how would one do this with Webpack?



from Replace object with static fields with the values of the fields in webpack

No comments:

Post a Comment