docs icon indicating copy to clipboard operation
docs copied to clipboard

sage docs: show examples of alternative bud config formats

Open retlehs opened this issue 4 years ago • 0 comments

in the sage docs, explain that the bud config can also be done in js, yml, json, ts

.js

module.exports = async ({env, path, ...app}) =>
  app
    .entry({
      app: ['@scripts/app', '@styles/app'],
      editor: ['@scripts/editor', '@styles/editor'],
    })
    .assets({
      from: path('@src/images'),
      to: path('@public/images'),
    })
    .watch(
      path('@views/**/*'),
      path('app/**/*')
    )
    .serve({
      cert: env.get('BUD_SSL_CERT'),
      key: env.get('BUD_SSL_KEY'),
    })

.yml

entry:
  app:
    - '@scripts/app'
    - '@styles/app'
  editor:
    - '@scripts/editor'
    - '@styles/editor'
assets:
  - images
watch:
  - resources/views/**/*
  - app/**/*
proxy: http://0.0.0.0:8000
serve: http://localhost:3000

.json

{
  "entry": {
    "app": ["@scripts/app", "@styles/app"],
    "editor": ["@scripts/editor", "@styles/editor"]
  },
  "assets": ["images"]
}

.ts

export default async ({env, path, ...app}: Framework) =>
  app
    .entry({
      app: ['@scripts/app', '@styles/app'],
      editor: ['@scripts/editor', '@styles/editor'],
    })
    .assets({
      from: path('@src/images'),
      to: path('@public/images'),
    })
    .watch(
      path('@views/**/*'),
      path('app/**/*')
    )
    .serve({
      cert: env.get('BUD_SSL_CERT'),
      key: env.get('BUD_SSL_KEY'),
    })

retlehs avatar Apr 04 '22 18:04 retlehs