1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | function cdn(url) {
|
8 | return {
|
9 | plugin: 'cdn',
|
10 | url
|
11 | };
|
12 | }
|
13 |
|
14 | exports.cdn = cdn;
|
15 |
|
16 | function entry(entries) {
|
17 | return {
|
18 | plugin: 'entry',
|
19 | entries
|
20 | };
|
21 | }
|
22 |
|
23 | exports.entry = entry;
|
24 |
|
25 | function experiments({
|
26 | fastStartup = false,
|
27 | optimizeLodash = false,
|
28 | railsWithNodeServer = false,
|
29 | reactLoadable = false
|
30 | }) {
|
31 | return {
|
32 | plugin: 'experiments',
|
33 | fastStartup,
|
34 | optimizeLodash,
|
35 | reactLoadable,
|
36 | railsWithNodeServer
|
37 | };
|
38 | }
|
39 |
|
40 | exports.experiments = experiments;
|
41 |
|
42 | function externals(externals) {
|
43 | return {
|
44 | plugin: 'externals',
|
45 | externals
|
46 | };
|
47 | }
|
48 |
|
49 | exports.externals = externals;
|
50 |
|
51 | function isGraphQLMultipleRemoteSchemaConfig(config) {
|
52 | return Boolean(config.projects);
|
53 | }
|
54 |
|
55 | exports.isGraphQLMultipleRemoteSchemaConfig = isGraphQLMultipleRemoteSchemaConfig;
|
56 |
|
57 | function graphql({
|
58 | schema,
|
59 | customScalars
|
60 | }) {
|
61 | const schemas = [];
|
62 |
|
63 | if (typeof schema === 'string') {
|
64 | schemas.push([undefined, {
|
65 | production: schema
|
66 | }]);
|
67 | } else if (isGraphQLMultipleRemoteSchemaConfig(schema)) {
|
68 | schemas.push(...Object.entries(schema.projects));
|
69 | } else {
|
70 | schemas.push([undefined, schema]);
|
71 | }
|
72 |
|
73 | return {
|
74 | plugin: 'graphql',
|
75 | schemas: new Map(schemas),
|
76 | customScalars
|
77 | };
|
78 | }
|
79 |
|
80 | exports.graphql = graphql;
|
81 |
|
82 | function jest(configure) {
|
83 | return {
|
84 | plugin: 'jest',
|
85 | configure
|
86 | };
|
87 | }
|
88 |
|
89 | exports.jest = jest;
|
90 |
|
91 | function manifest(filename) {
|
92 | return {
|
93 | plugin: 'manifest',
|
94 | filename
|
95 | };
|
96 | }
|
97 |
|
98 | exports.manifest = manifest;
|
99 |
|
100 | function paths(paths) {
|
101 | return {
|
102 | plugin: 'paths',
|
103 | paths
|
104 | };
|
105 | }
|
106 |
|
107 | exports.paths = paths;
|
108 |
|
109 | function sass({
|
110 | autoInclude = [],
|
111 | autoImportPolaris = true
|
112 | }) {
|
113 | return {
|
114 | plugin: 'sass',
|
115 | autoInclude,
|
116 | autoImportPolaris
|
117 | };
|
118 | }
|
119 |
|
120 | exports.sass = sass;
|
121 |
|
122 | function webpack(configure) {
|
123 | return {
|
124 | plugin: 'webpack',
|
125 | configure
|
126 | };
|
127 | }
|
128 |
|
129 | exports.webpack = webpack;
|
130 |
|
131 | function vendors(modules) {
|
132 | return {
|
133 | plugin: 'vendors',
|
134 | modules
|
135 | };
|
136 | }
|
137 |
|
138 | exports.vendors = vendors;
|
139 |
|
140 | function devServer(options) {
|
141 | return Object.assign({
|
142 | plugin: 'devServer'
|
143 | }, options);
|
144 | }
|
145 |
|
146 | exports.devServer = devServer;
|
147 |
|
148 | function rollup(configure) {
|
149 | return {
|
150 | plugin: 'rollup',
|
151 | configure
|
152 | };
|
153 | }
|
154 |
|
155 | exports.rollup = rollup; |
\ | No newline at end of file |