feat & refactor: webpack-serve-waitpage and lint

This commit is contained in:
endiliey 2018-08-01 16:18:52 +08:00
parent 82be417197
commit d9a86a54c1
9 changed files with 75 additions and 54 deletions

View file

@ -1,14 +1,14 @@
const path = require('path');
const fs = require('fs-extra');
const genPath = path.resolve(__dirname, '../generated');
fs.ensureDirSync(genPath);
const genCache = new Map();
module.exports = async function(file, content) {
const cached = genCache.get(file);
if (cached !== content) {
await fs.writeFile(path.join(genPath, file), content);
genCache.set(file, content);
}
};
const path = require('path');
const fs = require('fs-extra');
const genPath = path.resolve(__dirname, '../generated');
fs.ensureDirSync(genPath);
const genCache = new Map();
module.exports = async function(file, content) {
const cached = genCache.get(file);
if (cached !== content) {
await fs.writeFile(path.join(genPath, file), content);
genCache.set(file, content);
}
};