Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit f80fefd

Browse files
committed
Switch from rollup to laravel-mix
1 parent be5e098 commit f80fefd

File tree

9 files changed

+12594
-4805
lines changed

9 files changed

+12594
-4805
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ All notable changes to `laravel-form-components` will be documented in this file
88

99
### Updated
1010
- Update asset versions in the config
11+
- Reference all `form-components` components using `<x-form-components::>` instead of `<x-dynamic-component>`
12+
13+
### Changed
14+
- Switch from rollup to laravel-mix for compiling package JavaScript
1115

1216
### Breaking changes
1317
- Increase minimum Laravel version to `8.58`

bin/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
npx rollup -c
3+
npx mix --production

dist/form-components.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/mix-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"/form-components.js": "/form-components.js?id=8a17570b1e33ac3125b9"
3+
}

package-lock.json

Lines changed: 12576 additions & 4753 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/FormComponents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private function javaScriptAssets(array $options = []): string
8686
{
8787
$appUrl = config('form-components.asset_url', rtrim($options['asset_url'] ?? '', '/'));
8888

89-
$manifest = json_decode(file_get_contents(__DIR__ . '/../dist/manifest.json'), true);
89+
$manifest = json_decode(file_get_contents(__DIR__ . '/../dist/mix-manifest.json'), true);
9090
$versionedFileName = $manifest['/form-components.js'];
9191

9292
$fullAssetPath = "{$appUrl}/form-components{$versionedFileName}";

webpack.mix.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const mix = require('laravel-mix');
2+
3+
mix.setPublicPath('dist');
4+
5+
mix.js('resources/js/index.js', 'form-components.js')
6+
.sourceMaps(false)
7+
.version()
8+
.disableSuccessNotifications();

0 commit comments

Comments
 (0)