|
1 | 1 | /** |
2 | | - * Copyright 2019, Optimizely |
| 2 | + * Copyright 2019, 2023 Optimizely |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
6 | 6 | * You may obtain a copy of the License at |
7 | 7 | * |
8 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 | * |
10 | 10 | * Unless required by applicable law or agreed to in writing, software |
11 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -const fs = require("fs"); |
18 | | -const path = require("path"); |
19 | | -const execSync = require("child_process").execSync; |
| 17 | +const path = require('path'); |
| 18 | +const execSync = require('child_process').execSync; |
20 | 19 |
|
21 | | -process.chdir(path.resolve(__dirname, "..")); |
| 20 | +process.chdir(path.resolve(__dirname, '..')); |
22 | 21 |
|
23 | 22 | function exec(command, extraEnv) { |
24 | 23 | return execSync(command, { |
25 | | - stdio: "inherit", |
26 | | - env: Object.assign({}, process.env, extraEnv) |
| 24 | + stdio: 'inherit', |
| 25 | + env: Object.assign({}, process.env, extraEnv), |
27 | 26 | }); |
28 | 27 | } |
29 | 28 |
|
30 | 29 | const packageName = 'react-sdk'; |
31 | | -const umdName = 'optimizelyReactSdk' |
32 | | - |
33 | | -console.log("\nBuilding ES modules..."); |
| 30 | +const umdName = 'optimizelyReactSdk'; |
34 | 31 |
|
| 32 | +console.log('\nBuilding ES modules...'); |
35 | 33 | exec(`./node_modules/.bin/rollup -c scripts/config.js -f es -o dist/${packageName}.es.js`); |
36 | 34 |
|
37 | | -console.log("\nBuilding CommonJS modules..."); |
38 | | - |
| 35 | +console.log('\nBuilding CommonJS modules...'); |
39 | 36 | exec(`./node_modules/.bin/rollup -c scripts/config.js -f cjs -o dist/${packageName}.js`); |
40 | 37 |
|
41 | | -console.log("\nBuilding UMD modules..."); |
42 | | - |
43 | | -exec(`./node_modules/.bin/rollup -c scripts/config.js -f umd -o dist/${packageName}.umd.js --name ${umdName}`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); |
44 | | - |
45 | | -console.log("\nBuilding SystemJS modules..."); |
46 | | - |
47 | | -exec(`./node_modules/.bin/rollup -c scripts/config.js -f system -o dist/${packageName}.system.js`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); |
| 38 | +console.log('\nBuilding UMD modules...'); |
| 39 | +exec(`./node_modules/.bin/rollup -c scripts/config.js -f umd -o dist/${packageName}.umd.js --name ${umdName}`, { |
| 40 | + EXTERNALS: 'forBrowsers', |
| 41 | + BUILD_ENV: 'production', |
| 42 | +}); |
| 43 | + |
| 44 | +console.log('\nBuilding SystemJS modules...'); |
| 45 | +exec(`./node_modules/.bin/rollup -c scripts/config.js -f system -o dist/${packageName}.system.js`, { |
| 46 | + EXTERNALS: 'forBrowsers', |
| 47 | + BUILD_ENV: 'production', |
| 48 | +}); |
0 commit comments