@samitouri / QOS-React / commits / 1bab82a9de

Tweaks the build script (#12444)

Branch: build-tweaks

Maël Nison committed Mar 23, 2018 at 19:51 UTC 1bab82a9de2b6f633656f791d85143fae9f3b3c9
2 files changed +4 -5
scripts/rollup/build.js
+1 -1
@@ -72,7 +72,7 @@ const closureOptions = {
72
73 function getBabelConfig(updateBabelOptions, bundleType, filename) {
74 let options = {
75 - exclude: 'node_modules/**',
75 + exclude: '/**/node_modules/**',
76 presets: [],
77 plugins: [],
78 };
scripts/rollup/modules.js
+3 -4
@@ -1,6 +1,5 @@
1 'use strict';
2
3 -const path = require('path');
3 const forks = require('./forks');
4 const bundleTypes = require('./bundles').bundleTypes;
5
@@ -44,9 +43,9 @@ function getPeerGlobals(externals, moduleType) {
43
44 // Determines node_modules packages that are safe to assume will exist.
45 function getDependencies(bundleType, entry) {
47 - const packageJson = require(path.basename(
48 - path.dirname(require.resolve(entry))
49 - ) + '/package.json');
46 + // Replaces any part of the entry that follow the package name (like
47 + // "/server" in "react-dom/server") by the path to the package settings
48 + const packageJson = require(entry.replace(/(\/.*)?$/, '/package.json'));
49 // Both deps and peerDeps are assumed as accessible.
50 return Array.from(
51 new Set([