mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复deps映射目录
This commit is contained in:
parent
f695864fd8
commit
55d7a49dbc
|
@ -1,10 +1,11 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import chokidar from 'chokidar';
|
import chokidar from 'chokidar';
|
||||||
|
import config from '../config/index';
|
||||||
|
|
||||||
function linkToNodeModule(src: string, dst?: string) {
|
function linkToNodeModule(src: string, dst?: string) {
|
||||||
const target = path.join(__dirname, 'node_modules', dst || src);
|
const target = path.join(config.rootPath, 'node_modules', dst || src);
|
||||||
const source = path.join(__dirname, src);
|
const source = path.join(config.rootPath, src);
|
||||||
|
|
||||||
fs.lstat(target, (err, stat) => {
|
fs.lstat(target, (err, stat) => {
|
||||||
if (!stat) {
|
if (!stat) {
|
||||||
|
@ -18,7 +19,7 @@ function linkToNodeModule(src: string, dst?: string) {
|
||||||
export default async (src: string = 'deps') => {
|
export default async (src: string = 'deps') => {
|
||||||
linkToNodeModule(src);
|
linkToNodeModule(src);
|
||||||
|
|
||||||
const source = path.join(__dirname, src);
|
const source = path.join(config.rootPath, src);
|
||||||
const watcher = chokidar.watch(source, {
|
const watcher = chokidar.watch(source, {
|
||||||
ignored: /(^|[\/\\])\../, // ignore dotfiles
|
ignored: /(^|[\/\\])\../, // ignore dotfiles
|
||||||
persistent: true,
|
persistent: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user