forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OccurrenceOrderPlugin spelling (kriasoft#683)
- Loading branch information
Showing
19 changed files
with
490 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
/** | ||
* React Starter Kit (https://www.reactstarterkit.com/) | ||
* | ||
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. | ||
* Copyright © 2014-present Kriasoft, LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
|
||
import del from 'del'; | ||
import fs from './lib/fs'; | ||
import { cleanDir } from './lib/fs'; | ||
|
||
/** | ||
* Cleans up the output (build) directory. | ||
*/ | ||
async function clean() { | ||
await del(['.tmp', 'build/*', '!build/.git'], { dot: true }); | ||
await fs.makeDir('build/public'); | ||
function clean() { | ||
return Promise.all([ | ||
cleanDir('build/*', { | ||
nosort: true, | ||
dot: true, | ||
ignore: ['build/.git', 'build/public'], | ||
}), | ||
|
||
cleanDir('build/public/*', { | ||
nosort: true, | ||
dot: true, | ||
ignore: ['build/public/.git'], | ||
}), | ||
]); | ||
} | ||
|
||
export default clean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* React Starter Kit (https://www.reactstarterkit.com/) | ||
* | ||
* Copyright © 2014-present Kriasoft, LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
|
||
import run from './run'; | ||
import compileClient from './compileClient'; | ||
import compileServer from './compileServer'; | ||
|
||
function compile() { | ||
return Promise.all([ | ||
run(compileClient), | ||
run(compileServer), | ||
]); | ||
} | ||
|
||
export default compile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* React Starter Kit (https://www.reactstarterkit.com/) | ||
* | ||
* Copyright © 2014-present Kriasoft, LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
|
||
import path from 'path'; | ||
const babel = require('babel-core'); | ||
import { readFile, writeFile, copyFile, readDir, makeDir } from './lib/fs'; | ||
|
||
/** | ||
* Compile server-side application from the source files. | ||
*/ | ||
async function compileServer() { | ||
const dirs = await readDir('**/*.*', { | ||
cwd: 'src', | ||
nosort: true, | ||
dot: false, | ||
ignore: [ | ||
'client.js', | ||
'public/*', | ||
'**/*.css', | ||
'**/*.client.js', | ||
'**/*.test.js', | ||
], | ||
}); | ||
|
||
await Promise.all(dirs.map(async dir => { | ||
const from = path.resolve('src', dir); | ||
const to = path.resolve('build', dir); | ||
const ext = path.extname(dir); | ||
await makeDir(path.dirname(to)); | ||
if (ext === '.js') { | ||
const file = await readFile(from); | ||
const result = babel.transform(file, { | ||
filename: dir, | ||
filenameRelative: from, | ||
sourceMaps: 'inline', | ||
}); | ||
return await writeFile(to, result.code); | ||
} | ||
return await copyFile(from, to); | ||
})); | ||
} | ||
|
||
export default compileServer; |
Oops, something went wrong.