Package Exports
- minista
- minista/dist/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minista) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
minista
About
Next.js Like Development with 100% Static Generate.
How To Use
Automatic Setup
$ npm init minista@next
Manual Setup
$ npm install --save-dev minista@next react react-dom
public # Copy dist
src
└── pages # Required!
├── about
│ └── index.tsx
└── index.tsx
const PageHome = () => {
return (
<h1>Home</h1>
)
}
export default PageHome
Open package.json
and add the following scripts:
"scripts": {
"dev": "minista",
"build": "minista build",
"preview": "minista preview",
}
Commands
command | detail |
---|---|
minista |
Development mode, Press Ctrl+C to stop |
minista build |
Static site generate |
minista preview |
Static data preview |
Customize
// minista.config.ts
import { defineConfig } from "minista"
export default defineConfig({
base: "/", // string
public: "public", // string
src: "src", // string
out: "dist", // string
root: {
srcDir: "", // string
srcName: "root", // string
srcExt: ["tsx", "jsx"], // string[]
},
pages: {
srcDir: "pages", // string
srcExt: ["tsx", "jsx", "md", "mdx"], // string[]
},
assets: {
entry: "", // string | string[] | { [key: string]: string }
srcDir: "assets", // string
outDir: "assets", // string
bundle: {
outDir: "", // string
outName: "bundle", // string
},
images: {
useDownload: false, // boolean
outDir: "images", // string
outName: "[name]", // string
},
fonts: {
outDir: "fonts", // string
outName: "[name]", // string
},
icons: {
useSprite: true, // boolean
srcDir: "icons", // string
outDir: "images", // string
outName: "icons", // string
svgstoreOptions: {
cleanSymbols: ["fill", "stroke", "stroke-linejoin", "stroke-width"],
}, // https://github.com/svgstore/svgstore#svgstore-options
},
},
vite: {}, // https://vitejs.dev/config/
markdown: {
syntaxHighlighter: "highlight", // "highlight" | "none"
highlightOptions: {}, // https://github.com/rehypejs/rehype-highlight#options
mdxOptions: {
remarkPlugins: [], // https://mdxjs.com/packages/mdx/#optionsremarkplugins
rehypePlugins: [], // https://mdxjs.com/packages/mdx/#optionsrehypeplugins
},
},
beautify: {
useHtml: true, // boolean
useCss: false, // boolean
useJs: false, // boolean
htmlOptions: {
indent_size: 2,
max_preserve_newlines: 0,
indent_inner_html: true,
extra_liners: [],
}, // https://github.com/beautify-web/js-beautify#css--html
cssOptions: {}, // https://github.com/beautify-web/js-beautify#css--html
jsOptions: {}, // https://github.com/beautify-web/js-beautify#options
},
})
License
- MIT