mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
5 changed files with 40 additions and 1 deletions
@ -0,0 +1,5 @@ |
|||||
|
module.exports = { |
||||
|
description: 'passes environment variables to config file', |
||||
|
command: 'rollup --config --environment PRODUCTION,FOO:bar', |
||||
|
execute: true |
||||
|
}; |
@ -0,0 +1,2 @@ |
|||||
|
assert.equal( '__ENVIRONMENT__', 'production' ); |
||||
|
assert.equal( '__FOO__', 'bar' ); |
@ -0,0 +1,12 @@ |
|||||
|
var replace = require( 'rollup-plugin-replace' ); |
||||
|
|
||||
|
module.exports = { |
||||
|
entry: 'main.js', |
||||
|
format: 'cjs', |
||||
|
plugins: [ |
||||
|
replace({ |
||||
|
__ENVIRONMENT__: process.env.PRODUCTION ? 'production' : 'development', |
||||
|
__FOO__: process.env.FOO |
||||
|
}) |
||||
|
] |
||||
|
}; |
Loading…
Reference in new issue