Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saade committed Aug 9, 2023
1 parent 89002f7 commit fb0cfd2
Show file tree
Hide file tree
Showing 24 changed files with 914 additions and 1,627 deletions.
56 changes: 56 additions & 0 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import esbuild from 'esbuild'

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

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

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

const defaultOptions = {
define: {
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`,
},
bundle: true,
mainFields: ['module', 'main'],
platform: 'neutral',
sourcemap: isDev ? 'inline' : false,
sourcesContent: isDev,
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}`)
})

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}`)
}
})
}
},
{
name: 'empty-css-imports',
setup(build) {
build.onLoad({ filter: /\.css$/ }, () => ({ contents: '' }))
},
}],
}

compile({
...defaultOptions,
entryPoints: ['./resources/js/filament-fullcalendar.js'],
outfile: './dist/filament-fullcalendar.js',
})
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
],
"homepage": "https://github.com/saade/filament-fullcalendar",
"license": "MIT",
"authors": [{
"name": "Saade",
"email": "[email protected]",
"role": "Developer"
}],
"authors": [
{
"name": "Saade",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"filament/filament": "^3.0",
Expand Down Expand Up @@ -57,12 +59,9 @@
"laravel": {
"providers": [
"Saade\\FilamentFullCalendar\\FilamentFullCalendarServiceProvider"
],
"aliases": {
"FilamentFullCalendar": "Saade\\FilamentFullCalendar\\Facades\\FilamentFullCalendar"
}
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
2 changes: 1 addition & 1 deletion dist/filament-fullcalendar.css

Large diffs are not rendered by default.

147 changes: 121 additions & 26 deletions dist/filament-fullcalendar.js

Large diffs are not rendered by default.

Loading

0 comments on commit fb0cfd2

Please sign in to comment.