Skip to content

Commit

Permalink
Merge branch 'develop' into fix-skip-link-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 committed Apr 17, 2024
2 parents 0b0b9f2 + 947d8de commit 8a3bf0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
41 changes: 20 additions & 21 deletions build/build.js
Expand Up @@ -3,8 +3,8 @@ import { promises as fs } from 'fs';
import * as rollup from 'rollup';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import uglify from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import chokidar from 'chokidar';
import { relative } from './util.js';

Expand Down Expand Up @@ -54,6 +54,7 @@ async function build(opts) {
output: opts.globalName ? { name: opts.globalName } : {},
file: dest,
strict: false,
sourcemap: opts.sourcemap,
});
});
}
Expand All @@ -68,15 +69,14 @@ async function buildCore() {
})
);

if (isProd) {
promises.push(
build({
input: 'src/core/index.js',
output: 'docsify.min.js',
plugins: [uglify()],
})
);
}
promises.push(
build({
input: 'src/core/index.js',
output: 'docsify.min.js',
plugins: [terser()],
sourcemap: true,
})
);

await Promise.all(promises);
}
Expand All @@ -102,17 +102,16 @@ async function buildAllPlugin() {
});
});

if (isProd) {
plugins.forEach(item => {
promises.push(
build({
input: 'src/plugins/' + item.input,
output: 'plugins/' + item.name + '.min.js',
plugins: [uglify()],
})
);
});
}
plugins.forEach(item => {
promises.push(
build({
input: 'src/plugins/' + item.input,
output: 'plugins/' + item.name + '.min.js',
plugins: [terser()],
sourcemap: true,
})
);
});

await Promise.all(promises);
}
Expand Down
2 changes: 1 addition & 1 deletion build/mincss.js
Expand Up @@ -9,7 +9,7 @@ const files = fs
files.forEach(file => {
file = path.resolve('lib/themes', file);
cssnano
.process(fs.readFileSync(file))
.process(fs.readFileSync(file), { from: file })
.then(result => {
file = file.replace(/\.css$/, '.min.css');
fs.writeFileSync(file, result.css);
Expand Down
2 changes: 2 additions & 0 deletions server.configs.js
Expand Up @@ -24,6 +24,8 @@ export const devConfig = {
files: ['CHANGELOG.md', 'docs/**/*', 'lib/**/*'],
port: 3000,
rewriteRules,
reloadDebounce: 1000,
reloadOnRestart: true,
server: {
...prodConfig.server,
routes: {
Expand Down

0 comments on commit 8a3bf0e

Please sign in to comment.