Skip to content

Commit 54cbd83

Browse files
committed
build: remove optional extension after build
1 parent fea8b4a commit 54cbd83

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

gulpfile.js/index.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,22 @@ function _cleanPhoenixProGitFolder() {
9191

9292
function _deletePhoenixProSourceFolder() {
9393
return new Promise((resolve) => {
94-
// todo we cant do this yet lots of issues happening due to missing files in dist test mainly
95-
// which i also suspect are actual issues
96-
// const phoenixProFolders = [
97-
// 'dist/extensionsIntegrated/phoenix-pro',
98-
// 'dist-test/src/extensionsIntegrated/phoenix-pro'
99-
// ];
100-
//
101-
// for (const folder of phoenixProFolders) {
102-
// if (fs.existsSync(folder)) {
103-
// fs.rmSync(folder, { recursive: true, force: true });
104-
// console.log(`Deleted phoenix-pro source folder: ${folder}`);
105-
// }
106-
// }
94+
const phoenixProFolders = [
95+
// we only delete the source folder from the release build artifact and not the test artifact. why below?
96+
'dist/extensionsIntegrated/phoenix-pro'
97+
// 'dist-test/src/extensionsIntegrated/phoenix-pro' // ideally we should delete this too so that the tests
98+
// test exactly the release build artifact, but the spec runner requires on these files during test start
99+
// and i wasnt able to isolate them. so instead wehat we do now is that we have an additional test in prod
100+
// that checks that the phoenix-pro source folder is not loaded in prod and loaded only from the inlines
101+
// brackets-min file.
102+
];
103+
104+
for (const folder of phoenixProFolders) {
105+
if (fs.existsSync(folder)) {
106+
fs.rmSync(folder, { recursive: true, force: true });
107+
console.log(`Deleted phoenix-pro source folder: ${folder}`);
108+
}
109+
}
107110
resolve();
108111
});
109112
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Build notes
2+
All files this in this folder will be deleted in the prod build by the build script at `gulpfile.js/index.js`
3+
in phoenix code. This is because the code will be inlined in brackets-min.js. If you want to retain any files
4+
in this folder at distribution (strongly discouraged without reason), please update the function in
5+
build script `_deletePhoenixProSourceFolder()`. You may only do this for images,or other binary resources, which
6+
shouldn't be in the source in the first place.

0 commit comments

Comments
 (0)