forked from paypal/paypal-checkout-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
78 lines (69 loc) · 2.29 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
/* @flow */
/* eslint import/no-nodejs-modules: off, import/no-default-export: off */
import type { WebpackConfig } from 'grumbler-scripts/config/types';
import { getWebpackConfig } from 'grumbler-scripts/config/webpack.config';
import { ENV } from '@paypal/sdk-constants';
import { testGlobals } from './test/globals';
import globals from './globals';
const FILE_NAME = 'sdk';
const PROTOCOL = 'https';
const HOSTNAME = 'localhost.paypal.com';
const PORT = 9001;
const WEBPACK_CONFIG_DEV : WebpackConfig = getWebpackConfig({
entry: './paypal.dev.js',
filename: `${ FILE_NAME }.js`,
debug: true,
minify: false,
env: ENV.LOCAL,
vars: {
...globals,
...testGlobals,
__PROTOCOL__: PROTOCOL,
__HOST__: `${ HOSTNAME }:${ PORT }`,
__SDK_HOST__: `${ HOSTNAME }:${ PORT }`,
__PORT__: PORT,
__PATH__: `/${ FILE_NAME }.js`,
__PAYPAL_CHECKOUT__: {
...testGlobals.__PAYPAL_CHECKOUT__,
__URI__: {
__CHECKOUT__: `/demo/dev/checkout.htm`,
__BUTTONS__: `/demo/dev/button.htm`,
__MENU__: `/demo/dev/menu.htm`
}
}
}
});
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: '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
];