0.5.2 • Published 2 months ago

vite-layers v0.5.2

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

vite-layers

layers support for vite,quickly inherit your vite configuration

Motivation

I want to inherit the configuration of the vite project in workspace and npm package

Features

  1. inherit configuration file
    • npm package
    • relative position

Usage

install

npm i vite-layers -D

configuration

// vite.config.ts
import { Layers } from "vite-layers";

export default Layers({
  // Your own vite configuration now
  vite: {
    server: {
      port: 3000,
    },
  },
  extends: "../vite-vue", // The target directory you want to inherit
});

manual import

import Config from "../vite-vue/vite.config.ts"; // Manual Import Config
// vite.config.ts
import { Layers } from "vite-layers";

export default Layers({
  extends: Config, // The target directory you want to inherit
});

multiple

// vite.config.ts
import Config from "../vite-vue/vite.config.ts"; // Manual Import Config
import { Layers } from "vite-layers";

export default Layers({
  extends: [
    "../../vite-vue",
    Config,
  ], // Multiple target directories to inherit
});

normalize

// vite.config.ts
import { Layers } from "vite-layers";

export default Layers({
  normalize(config) {
    // Allows you to modify the final configuration
    return config;
  },
  extends: [
    "../../vite-vue",
  ],
});

npm package

// vite.config.ts
import { Layers } from "vite-layers";

export default Layers({
  extends: [
    "package", // your package
  ],
});

ts

If you are using TS and there is tsconfig.node.json, you need to add types

{
  "compilerOptions": {
    "types": ["vite"] // add vite
    // ...other content
  }
}

inspiration

Inspired by nuxt/layers

License

Made with markthree

Published under MIT License.

0.5.2

2 months ago

0.5.0

4 months ago

0.5.1

4 months ago

0.4.0

4 months ago

0.3.9

9 months ago

0.3.6

9 months ago

0.3.8

9 months ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.3

1 year ago