Skip to content

Commit 4575d7f

Browse files
committed
Merge branch 'new-asset-system' into refactor-hydefront-styles-to-tailwind
2 parents c6dc8bd + b418b52 commit 4575d7f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128

129129
- name: Build assets for production
130130
working-directory: 'packages/hydefront'
131-
run: npm run build
131+
run: npm run prod
132132

133133
- name: Upload artifacts
134134
uses: actions/upload-artifact@v4

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ This serves two purposes:
123123
### Fixed
124124

125125
- Added missing collection key types in Hyde facade method annotations in https://github.com/hydephp/develop/pull/1784
126+
- The `app.js` file will now only be compiled if it has scripts in https://github.com/hydephp/develop/pull/2028
126127

127128
### Security
128129

vite.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ const hydeVitePlugin = () => ({
3737
}
3838
});
3939

40+
const hasJavaScriptContent = () => {
41+
const appJsPath = resolve(__dirname, 'resources/assets/app.js');
42+
if (!fs.existsSync(appJsPath)) return false;
43+
const content = fs.readFileSync(appJsPath, 'utf-8');
44+
return content.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, '').trim().length > 0;
45+
};
46+
4047
export default defineConfig({
4148
server: {
4249
port: 5173,
@@ -60,7 +67,7 @@ export default defineConfig({
6067
emptyOutDir: false,
6168
rollupOptions: {
6269
input: [
63-
resolve(__dirname, 'resources/assets/app.js'),
70+
...(hasJavaScriptContent() ? [resolve(__dirname, 'resources/assets/app.js')] : []),
6471
resolve(__dirname, 'resources/assets/app.css')
6572
],
6673
output: {

0 commit comments

Comments
 (0)