Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"prop-types": "^15.6.0",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-alias": "^1.2.1",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-closure-compiler-js": "^1.0.4",
"rollup-plugin-commonjs": "^8.0.2",
Expand Down
15 changes: 14 additions & 1 deletion scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,17 @@ function getCommonJsConfig(bundleType) {
}
}

// for use with rollup repalce plugin:
// windows paths breaks the string if we dosn't replace all "\" with "/"
// it only make effect on windows paths
function normalizeWindowsPathsInReplaceModules(mapToReplace) {
const newMap = {};
Object.keys(mapToReplace).forEach(key => {
newMap[key] = mapToReplace[key].replace(/\\/g, '/');
});
return newMap;
}

function getPlugins(
entry,
babelOpts,
Expand Down Expand Up @@ -391,7 +402,9 @@ function getPlugins(
// We have to do this check because Rollup breaks on empty object.
// TODO: file an issue with rollup-plugin-replace.
if (Object.keys(replaceModules).length > 0) {
plugins.unshift(replace(replaceModules));
plugins.unshift(
replace(normalizeWindowsPathsInReplaceModules(replaceModules))
);
}

const headerSanityCheck = getHeaderSanityCheck(bundleType, hasteName);
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4131,9 +4131,9 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1:
dependencies:
glob "^7.0.5"

rollup-plugin-alias@^1.2.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-1.3.1.tgz#a9152fec4b6a6510dae93989517ca7853c32a6fa"
rollup-plugin-alias@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9"
dependencies:
slash "^1.0.0"

Expand Down