forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreset.js
More file actions
31 lines (28 loc) · 702 Bytes
/
preset.js
File metadata and controls
31 lines (28 loc) · 702 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
function webpack(webpackConfig = {}, options = {}) {
const { module = {} } = webpackConfig;
const { loaderOptions, rule = {} } = options;
return {
...webpackConfig,
module: {
...module,
rules: [
...(module.rules || []),
{
test: [/\.stories\.(jsx?$|tsx?$)/],
...rule,
enforce: 'pre',
use: [
{
loader: require.resolve('@storybook/source-loader'),
options: loaderOptions,
},
],
},
],
},
};
}
function managerEntries(entry = []) {
return [...entry, require.resolve('./dist/esm/manager')];
}
module.exports = { webpack, managerEntries };