Prettify all JavaScript files (#964)

* Prettify all JavaScript files

* Make trailingComma all

* Delete v2/.prettierignore

* Remove v2 Prettier commands in package.json
This commit is contained in:
Yangshun Tay 2018-09-17 15:34:55 +08:00 committed by GitHub
parent a1de6dab04
commit 9d4a5d5359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 441 additions and 473 deletions

View file

@ -42,7 +42,7 @@ module.exports = async function build(siteDir, cliOptions = {}) {
// apply user webpack config
const {
siteConfig: {configureWebpack}
siteConfig: {configureWebpack},
} = props;
clientConfig = applyConfigureWebpack(configureWebpack, clientConfig, false);
serverConfig = applyConfigureWebpack(configureWebpack, serverConfig, true);
@ -58,20 +58,20 @@ module.exports = async function build(siteDir, cliOptions = {}) {
const {outDir} = props;
const staticDir = path.resolve(siteDir, 'static');
const staticFiles = await globby(['**'], {
cwd: staticDir
cwd: staticDir,
});
await Promise.all(
staticFiles.map(async source => {
const fromPath = path.resolve(staticDir, source);
const toPath = path.resolve(outDir, source);
return fs.copy(fromPath, toPath);
})
}),
);
const relativeDir = path.relative(process.cwd(), outDir);
console.log(
`\n${chalk.green('Success!')} Generated static files in ${chalk.cyan(
relativeDir
)}.\n`
relativeDir,
)}.\n`,
);
};