}), b.add("klaw-sync", () => { klawSync("node_modules", {}); }), b.add("recur-readdir sync", () => {
const getUrlFilePaths = () => { const options = { nofile: true }; const paths = klawSync(LOCAL_URL_DIR, options); return paths; }
filter(file) { return path.extname(file.path) === '.vue' }
const listRoutes = () => { const urlConfig = getUrlConfig(); if(urlConfig) { const urls = getUrlsFromJson(urlConfig); createLogMessage(urls); process.exit(0); } try { const paths = getUrlFilePaths().map((item) => removeLocalDir(item.path, LOCAL_URL_DIR)); createLogMessage(paths); } catch (e) { console.error('Url path does\'t exist', e); } process.exit(0); }
function findLastModifiedFile(path) { if (!fse.existsSync(path)) { return undefined; } const stat = fse.statSync(path); if (!stat || (!stat.isFile() && !stat.isDirectory())) { return undefined; } if (stat.isFile()) { return { path: path, stats: stat }; } const files = klawSync(path, { nodir: true }); return files.reduce((previous, current) => { return !previous || current.stats.mtime > previous.stats.mtime ? current : previous; }, undefined); }
vues.map(vue => { let filename if (process.platform !== 'win32') { filename = vue.path.substring(pagesIndex + 1).replace(/\.vue$/, '.html').replace(/\//g, '-') } else { filename = vue.path.substring(pagesIndex + 1).replace(/\.vue$/, '.html').replace(/\\/g, '-') } const page = filename.substring(0, filename.lastIndexOf(".")) // console.log(filename) // console.log(page) pages[page] = { entry: vue.path, template: './public/page.ejs', filename, chunks: [page, 'runtime'], name: page, minify: { collapseWhitespace: true, removeComments: true, removeRedundantAttributes: true, removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true, useShortDoctype: true } } })
files.forEach(function (connectorConfigFile) { const configFile = JSON.parse( fs.readFileSync(connectorConfigFile.path, "utf8") ); const connectorPackageName = configFile.type; const prod = argv.prod; const basename = path.basename(connectorConfigFile.path, ".json"); connectorConfigFile.path ), path: "connector.json"