Skip to content

Commit

Permalink
Fix assets management
Browse files Browse the repository at this point in the history
  • Loading branch information
invaders-xx committed Apr 23, 2024
1 parent d23ad35 commit ae9f0b1
Show file tree
Hide file tree
Showing 23 changed files with 4,876 additions and 158 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,6 @@ public function getTreeRecordIcon(?\Illuminate\Database\Eloquent\Model $record =
}
```

![tree-icon](https://github.com/solutionforest/filament-tree/assets/68525320/6a1ef719-9029-4e91-a20a-515a514c4326)

#### Node collapsed state

You can customize a collapsed state of the node. If you would like to show your tree initially collapsed you can use:
Expand Down
57 changes: 33 additions & 24 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import esbuild from 'esbuild'
import esbuild from 'esbuild';

const isDev = process.argv.includes('--dev')
const isDev = process.argv.includes('--dev');

async function compile(options) {
const context = await esbuild.context(options)
const context = await esbuild.context(options);

if (isDev) {
await context.watch()
await context.watch();
} else {
await context.rebuild()
await context.dispose()
await context.rebuild();
await context.dispose();
}
}

Expand All @@ -25,26 +25,35 @@ const defaultOptions = {
treeShaking: true,
target: ['es2020'],
minify: !isDev,
plugins: [{
name: 'watchPlugin',
setup: function (build) {
build.onStart(() => {
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
})
plugins: [
{
name: 'watchPlugin',
setup: function (build) {
build.onStart(() => {
console.log(
`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`,
);
});

build.onEnd((result) => {
if (result.errors.length > 0) {
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors)
} else {
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
}
})
}
}],
}
build.onEnd((result) => {
if (result.errors.length > 0) {
console.log(
`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`,
result.errors,
);
} else {
console.log(
`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`,
);
}
});
},
},
],
};

compile({
...defaultOptions,
entryPoints: ['./node_modules/nested-sort/dist/nested-sort.umd.min.js'],
entryPoints: ['./resources/js/filament-nested-list.js'],
outfile: './resources/dist/filament-nested-list.js',
})
});
Loading

0 comments on commit ae9f0b1

Please sign in to comment.