forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreset.js
28 lines (23 loc) · 764 Bytes
/
preset.js
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
const { join } = require('path');
const { ContextReplacementPlugin } = require('webpack');
const managerWebpack = async (config) => {
// See https://github.com/graphql/graphql-language-service/issues/111#issuecomment-306723400
config.plugins.push(
new ContextReplacementPlugin(/graphql-language-service-interface[/\\]dist/, /\.js$/)
);
config.module.rules.push({
test: /\.js$/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
sourceType: 'unambiguous',
plugins: [[require.resolve('@babel/plugin-transform-classes'), { loose: true }]],
},
},
],
include: new RegExp(join('node_modules', 'graphql-')),
});
return config;
};
module.exports = { managerWebpack };