Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tree-shake-handle…
Browse files Browse the repository at this point in the history
…-assignments-in-dead-code
  • Loading branch information
lukastaegert committed Dec 16, 2019
2 parents 46f12d2 + 396f238 commit 1b6bc8d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,14 @@
# rollup changelog

## 1.27.13
*2019-12-14*

### Bug Fixes
* Do not truncate environment variable values at the first colon when using the `--environment` option (#3283)

### Pull Requests
* [#3283](https://github.com/rollup/rollup/pull/3283): Allow environment variables to contain colons (@tlaverdure)

## 1.27.12
*2019-12-13*

Expand Down
10 changes: 5 additions & 5 deletions cli/run/index.ts
Expand Up @@ -9,7 +9,7 @@ import build from './build';
import loadConfigFile from './loadConfigFile';
import watch from './watch';

export default function runRollup(command: any) {
export default function runRollup (command: any) {
let inputSource;
if (command._.length > 0) {
if (command.input) {
Expand Down Expand Up @@ -47,9 +47,9 @@ export default function runRollup(command: any) {

environment.forEach((arg: string) => {
arg.split(',').forEach((pair: string) => {
const [key, value] = pair.split(':');
if (value) {
process.env[key] = value;
const [key, ...value] = pair.split(':');
if (value.length) {
process.env[key] = value.join(':');
} else {
process.env[key] = String(true);
}
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function runRollup(command: any) {
}
}

function execute(configFile: string, configs: GenericConfigObject[], command: any) {
function execute (configFile: string, configs: GenericConfigObject[], command: any) {
if (command.watch) {
watch(configFile, configs, command, command.silent);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "rollup",
"version": "1.27.12",
"version": "1.27.13",
"description": "Next-generation ES module bundler",
"main": "dist/rollup.js",
"module": "dist/rollup.es.js",
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/config-env/_config.js
@@ -1,5 +1,5 @@
module.exports = {
description: 'passes environment variables to config file',
command: 'rollup --config --environment PRODUCTION,FOO:bar',
command: 'rollup --config --environment PRODUCTION,FOO:bar,HOST:http://localhost:4000',
execute: true
};
1 change: 1 addition & 0 deletions test/cli/samples/config-env/main.js
@@ -1,2 +1,3 @@
assert.equal( '__ENVIRONMENT__', 'production' );
assert.equal( '__FOO__', 'bar' );
assert.equal( '__HOST__', 'http://localhost:4000' );
3 changes: 2 additions & 1 deletion test/cli/samples/config-env/rollup.config.js
Expand Up @@ -8,7 +8,8 @@ module.exports = {
plugins: [
replace( {
__ENVIRONMENT__: process.env.PRODUCTION ? 'production' : 'development',
__FOO__: process.env.FOO
__FOO__: process.env.FOO,
__HOST__: process.env.HOST
} )
]
};

0 comments on commit 1b6bc8d

Please sign in to comment.