Skip to content

Commit bc8cfc5

Browse files
committed
Always rename props on build
I'd like to produce non-minified builds of signals to help debug issues. So I've copied the same babel transform we use in Preact to always rename properties regardless of whether microbundle is minifying or not (`--no-compress`).
1 parent 28b5900 commit bc8cfc5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

babel.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
4+
const rename = {};
5+
const mangle = require("./mangle.json");
6+
for (let prop in mangle.props.props) {
7+
let name = prop;
8+
if (name[0] === "$") {
9+
name = name.slice(1);
10+
}
11+
12+
rename[name] = mangle.props.props[prop];
13+
}
14+
15+
return {
16+
plugins: [["babel-plugin-transform-rename-properties", { rename }]],
17+
};
18+
};

0 commit comments

Comments
 (0)