vaderjs 1.6.6 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.js CHANGED
@@ -179,11 +179,13 @@ async function generateApp() {
179
179
  globalThis.isBuilding = true;
180
180
  console.log(ansiColors.green('Building...'))
181
181
  console.log(`Starting build at ${new Date().toLocaleTimeString()}`)
182
- for (let fn of fnmap) {
183
- await fn.fn(vader)
184
- fnmap = fnmap.filter(v => v.code !== fn.code)
182
+ let plugins = config.plugins || []
183
+ for (let plugin of plugins) {
184
+ if (plugin.onBuildStart) {
185
+ await plugin.onBuildStart(vader)
186
+ }
185
187
  }
186
- // remove files from dist
188
+
187
189
  if (mode === 'development') {
188
190
  fs.rmdirSync(process.cwd() + '/dist', { recursive: true })
189
191
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "A simple and powerful JavaScript library for building modern web applications.",
5
5
  "bin": {
6
6
  "vaderjs": "./main.js"
@@ -40,18 +40,19 @@ export default {
40
40
  name: 'tailwindcss',
41
41
  description: 'TailwindCSS plugin for Vader.js',
42
42
  version: '0.0.1',
43
+ onBuildStart: async (vader) => {
44
+ vader.injectHTML(`<link rel="stylesheet" href="/public/tailwind.css">`)
45
+ },
43
46
  onBuildFinish: async (vader) => {
44
47
  if (!checkIfTailwindInstalled()) {
45
48
  console.error('TailwindCSS is not installed. Please install it using `bun install tailwindcss postcss-cli autoprefixer`')
46
49
  process.exit(1)
47
50
  }else{
48
51
  initTailwind()
49
- vader.onBuildStart(() => {
50
- vader.injectHTML(`<link rel="stylesheet" href="/public/tailwind.css">`)
51
- })
52
+
52
53
  vader.onFileChange('tailwind.config.js', async () => {
53
54
  console.log('Rebuilding TailwindCSS...')
54
- await vader.runCommand(['bun', 'run', 'postcss', 'public/styles.css', '-o', 'dist/public/tailwind.css'])
55
+ await vader.runCommand(['bun', 'run', 'tailwindcss', 'build', '-o', 'public/styles.css'])
55
56
  console.log('TailwindCSS rebuilt successfully!')
56
57
  })
57
58
  vader.runCommand(['bun', 'run', 'postcss', 'public/styles.css', '-o', 'dist/public/tailwind.css'])