forked from wp-graphql/wp-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
58 lines (56 loc) · 1.65 KB
/
webpack.config.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const defaults = require( '@wordpress/scripts/config/webpack.config' );
const path = require( 'path' );
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
// The plugin configuration overrides.
const plugins = [
new RemoveEmptyScriptsPlugin( {
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
} ),
];
module.exports = {
...defaults,
entry: {
index: path.resolve( process.cwd(), 'packages/wpgraphiql', 'index.js' ),
app: path.resolve( process.cwd(), 'packages/wpgraphiql', 'app.js' ),
graphiqlQueryComposer: path.resolve(
process.cwd(),
'packages/graphiql-query-composer',
'index.js'
),
graphiqlAuthSwitch: path.resolve(
process.cwd(),
'packages/graphiql-auth-switch',
'index.js'
),
graphiqlFullscreenToggle: path.resolve(
process.cwd(),
'packages/graphiql-fullscreen-toggle',
'index.js'
),
extensions: path.resolve(
process.cwd(),
"packages/extensions",
"index.js"
),
updates: path.resolve(
process.cwd(),
'packages/updates',
'index.scss'
),
},
plugins: [
...defaults.plugins.filter(
( plugin ) =>
! plugins.some(
( p ) => p.constructor.name === plugin.constructor.name
)
),
...plugins,
],
externals: {
react: 'React',
'react-dom': 'ReactDOM',
wpGraphiQL: 'wpGraphiQL',
graphql: 'wpGraphiQL.GraphQL',
},
};