-
Notifications
You must be signed in to change notification settings - Fork 566
/
webpack.config.dev.js
82 lines (72 loc) · 2.17 KB
/
webpack.config.dev.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* @flow */
/* eslint import/no-nodejs-modules: off, import/no-default-export: off */
import type { WebpackConfig } from "@krakenjs/webpack-config-grumbler/index.flow";
import { getWebpackConfig } from "@krakenjs/webpack-config-grumbler";
import { ENV } from "@paypal/sdk-constants";
import { getTestGlobals } from "./test/globals";
import globals from "./globals";
const FILE_NAME = "sdk";
const PROTOCOL = "https";
const HOSTNAME = "localhost.paypal.com";
const PORT = 9001;
const testGlobals = getTestGlobals(globals);
const WEBPACK_CONFIG_DEV: WebpackConfig = getWebpackConfig({
entry: "./paypal.dev.js",
filename: `${FILE_NAME}.js`,
debug: true,
minify: false,
env: ENV.LOCAL,
vars: {
...testGlobals,
__PROTOCOL__: PROTOCOL,
__HOST__: `${HOSTNAME}:${PORT}`,
__SDK_HOST__: `${HOSTNAME}:${PORT}`,
__PORT__: PORT,
__PATH__: `/${FILE_NAME}.js`,
__PAYPAL_DOMAIN__: "https://localhost.paypal.com:9001",
__PAYPAL_CHECKOUT__: {
...testGlobals.__PAYPAL_CHECKOUT__,
__URI__: {
__CHECKOUT__: `/demo/dev/checkout.htm`,
__BUTTONS__: `/demo/dev/button.htm`,
__MENU__: `/demo/dev/menu.htm`,
__CARD_FIELD__: `/demo/dev/cardfield.htm`,
__MESSAGE_MODAL__: `https://www.paypalobjects.com/upstream/bizcomponents/js/modal.js`,
},
},
},
});
const WEBPACK_CONFIG_BUTTON_RENDER: WebpackConfig = getWebpackConfig({
context: __dirname,
entry: "./src/ui/buttons",
filename: "button.js",
modulename: "button",
debug: true,
minify: false,
web: false,
libraryTarget: "global",
});
const WEBPACK_CONFIG_JSX_PRAGMATIC: WebpackConfig = getWebpackConfig({
context: __dirname,
entry: "@krakenjs/jsx-pragmatic",
filename: "jsx-pragmatic.js",
modulename: "jsx",
debug: true,
minify: false,
libraryTarget: "global",
});
const WEBPACK_CONFIG_SDK_CONSTANTS: WebpackConfig = getWebpackConfig({
context: __dirname,
entry: "@paypal/sdk-constants",
filename: "sdk-constants.js",
modulename: "constants",
debug: true,
minify: false,
libraryTarget: "global",
});
export default [
WEBPACK_CONFIG_DEV,
WEBPACK_CONFIG_BUTTON_RENDER,
WEBPACK_CONFIG_JSX_PRAGMATIC,
WEBPACK_CONFIG_SDK_CONSTANTS,
];