Skip to content

Commit

Permalink
Add build workflow and update package.json for compressing CSS using …
Browse files Browse the repository at this point in the history
…csso.
  • Loading branch information
murdercode committed Feb 8, 2024
1 parent 57b34f3 commit 538d488
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
# - run: npm test
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@
Our assets (CSS/JS) for Laravel Nova 4 improvements

# terser (https://github.com/terser/terser) for JS <- todo
# csso for CSS

# How to use

## Install
In `NovaServiceProvider`:
```php
public function boot()
{
// ...
Nova::style('nova-custom-panel-assets', 'https://cdn.jsdelivr.net/gh/The-3Labs-Team/nova-custom-panel-assets@main/dist/css/main.css');
// Nova::script('nova-custom-panel-assets', __DIR__.'/../dist/js/nova-custom-panel-assets.js');
}
```

Version 1: https://cdn.jsdelivr.net/gh/The-3Labs-Team/nova-custom-panel-assets@1/dist/css/main.css
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"scripts": {
"build": "csso src/css/main.css -o dist/css/main.css"
"build": "npm run compress:css",
"compress:css": "csso src/css/main.css -o dist/css/main.css"
},
"dependencies": {
"csso-cli": "^4.0.2"
Expand Down

0 comments on commit 538d488

Please sign in to comment.