build: add livereload in watch mode
This commit is contained in:
parent
b518ede0f9
commit
0afdb45449
3 changed files with 58 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import copy from "@guanghechen/rollup-plugin-copy";
|
||||
import livereload from "rollup-plugin-livereload";
|
||||
import styles from "rollup-plugin-styles";
|
||||
import { swc } from "rollup-plugin-swc3";
|
||||
|
||||
|
@ -25,6 +26,7 @@ const staticFiles = [
|
|||
"templates",
|
||||
];
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
const isWatch = process.env.ROLLUP_WATCH === "true";
|
||||
|
||||
/**
|
||||
* @type {import('rollup').RollupOptions}
|
||||
|
@ -74,6 +76,7 @@ const config = {
|
|||
],
|
||||
verbose: true,
|
||||
}),
|
||||
isWatch && livereload(distDirectory),
|
||||
],
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue