JSPM

@roots/bud-api

2023.2.21
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7350
  • Score
    100M100P100Q130762F
  • License MIT

bud.js core module

Package Exports

  • @roots/bud-api
  • @roots/bud-api/api
  • @roots/bud-api/methods
  • @roots/bud-api/methods/alias/handleCallback
  • @roots/bud-api/methods/alias/handleFallthrough
  • @roots/bud-api/methods/alias/handleRecords
  • @roots/bud-api/methods/alias/handleSignifierValuePair
  • @roots/bud-api/methods/alias/index
  • @roots/bud-api/methods/alias/isCallback
  • @roots/bud-api/methods/alias/isRecords
  • @roots/bud-api/methods/alias/isSignifierValuePair
  • @roots/bud-api/methods/alias/schema
  • @roots/bud-api/methods/alias/types
  • @roots/bud-api/methods/assets/index
  • @roots/bud-api/methods/bundle/index
  • @roots/bud-api/methods/compilePaths/compilePaths.method
  • @roots/bud-api/methods/compilePaths/compilePaths.types
  • @roots/bud-api/methods/compilePaths/index
  • @roots/bud-api/methods/config/index
  • @roots/bud-api/methods/define/index
  • @roots/bud-api/methods/devtool/index
  • @roots/bud-api/methods/entry/guards
  • @roots/bud-api/methods/entry/handleNamed
  • @roots/bud-api/methods/entry/handleNormalRecord
  • @roots/bud-api/methods/entry/handlePrimitive
  • @roots/bud-api/methods/entry/handleSimpleRecord
  • @roots/bud-api/methods/entry/index
  • @roots/bud-api/methods/entry/normalize
  • @roots/bud-api/methods/entry/schema
  • @roots/bud-api/methods/entry/types
  • @roots/bud-api/methods/experiments/index
  • @roots/bud-api/methods/externals/index
  • @roots/bud-api/methods/hash/index
  • @roots/bud-api/methods/html/helpers
  • @roots/bud-api/methods/html/index
  • @roots/bud-api/methods/index
  • @roots/bud-api/methods/minimize/index
  • @roots/bud-api/methods/persist/index
  • @roots/bud-api/methods/provide/index
  • @roots/bud-api/methods/proxy/helpers
  • @roots/bud-api/methods/proxy/index
  • @roots/bud-api/methods/proxy/proxy.method
  • @roots/bud-api/methods/proxy/proxy.types
  • @roots/bud-api/methods/runtime/index
  • @roots/bud-api/methods/serve/childError
  • @roots/bud-api/methods/serve/index
  • @roots/bud-api/methods/serve/serve.types
  • @roots/bud-api/methods/setProxyUrl/index
  • @roots/bud-api/methods/setProxyUrl/setProxyUrl.method
  • @roots/bud-api/methods/setPublicProxyUrl/index
  • @roots/bud-api/methods/setPublicProxyUrl/setPublicProxyUrl.method
  • @roots/bud-api/methods/setPublicUrl/index
  • @roots/bud-api/methods/setPublicUrl/setPublicUrl
  • @roots/bud-api/methods/setUrl/index
  • @roots/bud-api/methods/setUrl/setUrl.method
  • @roots/bud-api/methods/splitChunks/index
  • @roots/bud-api/methods/use/index
  • @roots/bud-api/methods/watch/index
  • @roots/bud-api/types

Readme

bud.js

MIT License npm Follow Roots

@roots/bud-api

bud.js core module


Installation

Install @roots/bud-api to your project.

Yarn:

yarn add @roots/bud-api --dev

npm:

npm install @roots/bud-api --save-dev

API

For full documentation refer to bud.js.org/docs.

bud.compilePaths

bud.compilePaths is used to specify directories which should be treated as source directories.

If you have errors which say something along the lines of You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file., this is probably the function you want to use to fix that!

By default, bud.js treats code outside of the @src directory (likely modules downloaded via npm or yarn) as code that has already been bundled by some other means. This is a huge performance boost for your project! If that code was already compiled by the package author it would be a waste of time and energy to compile it again.

However, some authors may publish uncompiled source code with the expectation that you will transpile it as part of your build process. This function simplifies the process of configuring bud.js to handle these cases.

bud.entry

bud.entry is used to specify and group assets to include in the compilation.

If no entrypoint is provided bud.js will attempt to compile src/index.js to dist/main.js.

bud.html

bud.html is used to configure your application's HTML wrapper.

bud.provide

bud.provide makes a variable or module available throughout the entire application.

bud.proxy

bud.proxy is a method that configures a proxy server for your development environment. This is useful when you need to proxy requests to a backend server, such as a WordPress site.

bud.serve

bud.serve is used to configure the development server.

You don't need to call this function unless you want to change the default server configuration.

bud.setPublicUrl

bud.setPublicUrl is used to specify the site-accessible URL for the dev server (if it differs from the internal URL).

For example: a dockerized app that needs to be accessible from the host at http://example.test but serves over http://0.0.0.0:8080.

bud.setPublicUrl

bud.setPublicProxyUrl is used to specify the site-accessible URL for the proxy server (if it differs from the internal URL).

For example: a dockerized app that has a service which needs to be accessible from the host at http://example.test but serves over http://0.0.0.0.

bud.watch

bud.watch is used to specify files which will trigger a full browser reload when changed.

Contributing

Contributions are welcome from everyone.

We have contribution guidelines to help you get started.

License

@roots/bud-api is licensed under MIT.

Community

Keep track of development and community news.

Sponsors

Bud is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.

KM Digital Carrot WordPress.com Pantheon Worksite Safety