0.1.0 • Published 2 years ago

@axel669/rollup-dollar-path v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Rollup $path

Installation

yarn add @axel669/rollup-dollar-path

Usage

import $path from "@axel669/rollup-dollar-path"

module.exports = {
    input: "main.mjs",
    output: {
        file: "build/script.js",
        format: "iife",
    },
    plugins: [
        //  NOTE: All paths are relative to directory rollup is being run in
        $path({
            //  Root folder to resolve for "$/"
            root: ".",
            //  Optional mappings for naming common imports
            paths: {
                $func: "functions",
                $seed: "seed.mjs"
            },
            //  Optional extensions to check when resolving
            //  default: [".js", ".mjs", ".svelte", ".jsx"]
            extensions: [".js", ".mjs", ".cjs"]
        })
    ]
}