File tree 2 files changed +17
-4
lines changed
2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 3
3
const { join } = require ( 'path' ) ;
4
4
5
5
module . exports = {
6
- entry : './wpapi.js' ,
6
+ entry : {
7
+ wpapi : './fetch' ,
8
+ 'wpapi-superagent' : './superagent' ,
9
+ } ,
10
+
11
+ // Use browser builtins instead of Node packages where appropriate.
12
+ externals : {
13
+ 'isomorphic-unfetch' : 'fetch' ,
14
+ 'form-data' : 'FormData' ,
15
+ } ,
16
+
17
+ node : {
18
+ fs : 'empty' ,
19
+ } ,
7
20
8
21
mode : 'development' ,
9
22
@@ -21,7 +34,7 @@ module.exports = {
21
34
22
35
output : {
23
36
path : join ( process . cwd ( ) , 'browser' ) ,
24
- filename : 'wpapi .js' ,
37
+ filename : '[name] .js' ,
25
38
library : 'WPAPI' ,
26
39
libraryTarget : 'umd' ,
27
40
} ,
@@ -30,7 +43,7 @@ module.exports = {
30
43
rules : [
31
44
{
32
45
test : / \. j s $ / ,
33
- exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
46
+ exclude : / ( n o d e _ m o d u l e s ) / ,
34
47
loader : require . resolve ( 'babel-loader' ) ,
35
48
options : {
36
49
presets : [ '@babel/preset-env' ] ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ module.exports = {
14
14
15
15
output : {
16
16
...config . output ,
17
- filename : 'wpapi .min.js' ,
17
+ filename : '[name] .min.js' ,
18
18
} ,
19
19
20
20
optimization : {
You can’t perform that action at this time.
0 commit comments