mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-03 12:39:41 +08:00
4ae87bb18b
* Update JS build - Change rollup build from API to config file - Change output dir from lib to dist - Update lib to dist path in related files - Update dependencies - Add banner comment to bundles - Add unminified plugin bundles * Update docs with v5 version lock and dist path * Update docs to reference minified themes * Clean up docs * Update CSS build - Change CSS build from API to CLI - Change output dir from lib to dist - Update lib to dist path in related files - Update dependencies - Add sourcemaps * Update dependencies * Clean up package.json and add keywords * Fix rimraf globs on Windows * Fix PostCSS CLI glob on Windows * Update test-related dependencies * Update emoji * Add engines prop to package.json
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
import * as path from 'node:path';
|
|
import * as url from 'node:url';
|
|
import { rewriteRules } from './middleware.js';
|
|
|
|
const __filename = url.fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
// Production (CDN URLs, watch disabled)
|
|
export const prodConfig = {
|
|
hostname: '127.0.0.1',
|
|
notify: false,
|
|
open: false,
|
|
port: 8080,
|
|
server: {
|
|
baseDir: './docs',
|
|
},
|
|
snippet: false,
|
|
ui: false,
|
|
};
|
|
|
|
// Development (local URLs, watch enabled)
|
|
export const devConfig = {
|
|
...prodConfig,
|
|
files: ['CHANGELOG.md', 'docs/**/*', 'dist/**/*'],
|
|
port: 3000,
|
|
rewriteRules,
|
|
reloadDebounce: 1000,
|
|
reloadOnRestart: true,
|
|
server: {
|
|
...prodConfig.server,
|
|
routes: {
|
|
'/changelog.md': path.resolve(__dirname, 'CHANGELOG.md'),
|
|
'/dist': path.resolve(__dirname, 'dist'),
|
|
'/node_modules': path.resolve(__dirname, 'node_modules'), // Required for automated Vue tests
|
|
},
|
|
},
|
|
snippet: true,
|
|
};
|
|
|
|
// Test (local URLs, watch disabled)
|
|
export const testConfig = {
|
|
...devConfig,
|
|
port: 4000,
|
|
server: {
|
|
...devConfig.server,
|
|
middleware: [
|
|
// Blank page required for test environment
|
|
{
|
|
route: '/_blank.html',
|
|
handle(req, res, next) {
|
|
res.setHeader('Content-Type', 'text/html');
|
|
res.end('<!DOCTYPE html><html><body></body></html>');
|
|
next();
|
|
},
|
|
},
|
|
],
|
|
},
|
|
snippet: false,
|
|
watch: false,
|
|
};
|