mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 22:06:17 -08:00
Fix dev.js
This commit is contained in:
1 parent
9cb8c56e4d
commit
dd8ba4c64d
9 files changed
+1119
-6
No files matched your search
+5
-1
@@ -8,6 +8,7 @@ import { Parcel } from '@parcel/core';
|
||||
import openBrowser from 'servor/utils/openBrowser.js';
|
||||
|
||||
async function develop(name) {
|
||||
let isOpenBrowser = false;
|
||||
const uncompiledPath = path.resolve(`docs/uncompiled/${name}`);
|
||||
const { version } = JSON.parse(fs.readFileSync(`${projects[name]}/package.json`, 'utf-8'));
|
||||
|
||||
@@ -18,7 +19,6 @@ async function develop(name) {
|
||||
port: 8081,
|
||||
});
|
||||
|
||||
openBrowser(url);
|
||||
process.chdir(projects[name]);
|
||||
|
||||
const bundler = new Parcel({
|
||||
@@ -52,6 +52,10 @@ async function develop(name) {
|
||||
if (event.type === 'buildSuccess') {
|
||||
const bundles = event.bundleGraph.getBundles();
|
||||
console.log(`[${name}]`, `✨ Built ${bundles.length} bundles in ${event.buildTime}ms!`);
|
||||
if (!isOpenBrowser) {
|
||||
isOpenBrowser = true;
|
||||
openBrowser(url);
|
||||
}
|
||||
} else if (event.type === 'buildFailure') {
|
||||
console.log(`[${name}]`, event.diagnostics);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user