-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.js
More file actions
40 lines (31 loc) · 830 Bytes
/
start.js
File metadata and controls
40 lines (31 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const webpack = require('webpack');
const config = require('./webpack.config.js');
const storybook = require('@storybook/html/standalone');
console.log('Starting dev server in watch mode...');
const watching = webpack(config).watch({}, (err, stats) => {
if (err) {
console.error(err.stack || err);
if (err.details) {
console.error(err.details);
}
return;
}
const info = stats.toJson();
if (stats.hasErrors()) {
console.error(info.errors);
}
if (stats.hasWarnings()) {
console.warn(info.warnings);
}
console.log('Compilation complete');
});
process.on('SIGTERM', function () {
watching.close(() => console.log('Dev server closed'));
});
console.log('Starting Storybook...');
storybook({
mode: 'dev',
port: 6006,
staticDir: ['./dist'],
configDir: './.storybook',
});