mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 01:27:35 +02:00
test: compile webpack config for dev and prod
This commit is contained in:
parent
a4f0ed7c94
commit
f07e7791fa
5 changed files with 72 additions and 48 deletions
12
test/webpack/compile.js
Normal file
12
test/webpack/compile.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import webpack from 'webpack';
|
||||
|
||||
export default function compile(config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
webpack(config, (err, stats) => {
|
||||
if (err || stats.hasErrors()) {
|
||||
reject(new Error(`Failed to compile with errors`));
|
||||
}
|
||||
resolve('Compiled successfully');
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue