UNPKG

@roots/bud-build

Version:

bud.js core module

54 lines (53 loc) 2.02 kB
import * as MiniCss from '@roots/bud-support/mini-css-extract-plugin'; export const css = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/css-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/css-loader not found`); } return makeLoader(path); }; export const csv = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/csv-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/csv-loader not found`); } return makeLoader(path); }; export const file = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/file-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/csv-loader not found`); } return makeLoader(path); }; export const html = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/html-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/html-loader not found`); } return makeLoader(path); }; export const remark = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/remark-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/remark-loader not found`); } return makeLoader(path); }; export const minicss = async ({ makeLoader, resolve }) => { return makeLoader(MiniCss.loader); }; export const style = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/style-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/style-loader not found`); } return makeLoader(path); }; export const yml = async ({ makeLoader, resolve }) => { const path = await resolve(`@roots/bud-support/yml-loader`, import.meta.url); if (!path) { throw new Error(`@roots/bud-support/yml-loader not found`); } return makeLoader(path); };