Skip to content

Commit

Permalink
Support for Statamic 5
Browse files Browse the repository at this point in the history
  • Loading branch information
martyf committed May 10, 2024
1 parent f0f3a95 commit d689ce7
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 23 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"extra": {
"statamic": {
"name": "Iconamic",
"description": "The SVG Icon Selector for Statamic 3"
"description": "The SVG Icon Selector for Statamic"
},
"laravel": {
"providers": [
Expand All @@ -20,8 +20,8 @@
}
},
"require": {
"php": "^8.0",
"statamic/cms": "~3.3|^4.0"
"php": "^8.2",
"statamic/cms": "^4.0 || ^5.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion dist/js/iconamic.js

This file was deleted.

17 changes: 5 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"private": true,
"scripts": {
"dev": "mix",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"dependencies": {
"laravel-mix": "^6.0.43"
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"vue-loader": "^15.10.1",
"vue-template-compiler": "^2.7.14"
"@vitejs/plugin-vue2": "^2.2.0",
"laravel-vite-plugin": "^0.7.2",
"vite": "^4.0.0"
}
}
1 change: 1 addition & 0 deletions resources/dist/build/assets/index-78a0ade5.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.iconamic-is-svg svg{width:28px;height:28px;object-fit:contain}
1 change: 1 addition & 0 deletions resources/dist/build/assets/index-f3f09a68.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions resources/dist/build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"resources/js/index.css": {
"file": "assets/index-78a0ade5.css",
"src": "resources/js/index.css"
},
"resources/js/index.js": {
"css": [
"assets/index-78a0ade5.css"
],
"file": "assets/index-f3f09a68.js",
"isEntry": true,
"src": "resources/js/index.js"
}
}
11 changes: 7 additions & 4 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class ServiceProvider extends AddonServiceProvider
IconamicFieldtype::class
];

protected $scripts = [
__DIR__.'/../dist/js/iconamic.js'
];

protected $tags = [
IconamicTag::class
];
Expand All @@ -25,4 +21,11 @@ class ServiceProvider extends AddonServiceProvider
// v1.0.2
MoveConfigFile::class
];

protected $vite = [
'input' => [
'resources/js/index.js',
],
'publicDirectory' => 'resources/dist',
];
}
15 changes: 15 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue2';

export default defineConfig({
plugins: [
laravel({
input: [
'resources/js/index.js'
],
publicDirectory: 'resources/dist',
}),
vue(),
],
});
3 changes: 0 additions & 3 deletions webpack.mix.js

This file was deleted.

0 comments on commit d689ce7

Please sign in to comment.