mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-19 06:12:30 +00:00
hot content reload
This commit is contained in:
parent
b7966ff7fa
commit
8dd73704e6
6 changed files with 86 additions and 15 deletions
quartz
|
@ -72,7 +72,7 @@ const BuildArgv = {
|
|||
serve: {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'run a local server to preview your Quartz'
|
||||
describe: 'run a local server to live-preview your Quartz'
|
||||
},
|
||||
port: {
|
||||
number: true,
|
||||
|
@ -255,6 +255,7 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started.
|
|||
setup(build) {
|
||||
build.onLoad({ filter: /\.inline\.(ts|js)$/ }, async (args) => {
|
||||
let text = await promises.readFile(args.path, 'utf8')
|
||||
|
||||
// remove default exports that we manually inserted
|
||||
text = text.replace('export default', '')
|
||||
text = text.replace('export', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue