UNPKG

970 BJavaScriptView Raw
1import fs from 'fs';
2// eslint-disable-next-line import/no-extraneous-dependencies
3import { createPlugin } from 'docz-core';
4/**
5 * import { createPlugin } from 'docz-core';
6 * 'docz-core' is a peer-dependecy of docz
7 *
8 * Reference for doczPluginNetlify
9 * https://github.com/nicholasess/docz-plugin-netlify
10 *
11 * Inspired on
12 * Rewrite rule: /index.html 200
13 * Reference: https://www.netlify.com/docs/redirects/#rewrites-and-proxying
14 */
15
16const doczPluginNetlify = () => {
17 return createPlugin({
18 onPostBuild: config => {
19 const { dest } = config;
20 fs.writeFileSync(`./${dest}/_redirects`, '/* /index.html 200', {
21 encoding: 'utf8',
22 });
23 },
24 });
25};
26
27export default {
28 title: 'Melting Pot',
29 description: 'A utility library for daily use.',
30 source: './docs',
31 debug: false,
32 theme: 'docz-theme-default',
33 themeConfig: {
34 mode: 'dark',
35 colors: {
36 primary: 'tomato',
37 },
38 },
39 plugins: [doczPluginNetlify()],
40};