Skip to content

Commit

Permalink
add various missing options
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 20, 2017
1 parent 30cd1ca commit 0eb4fc1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions bin/src/run/mergeOptions.js
Expand Up @@ -13,9 +13,16 @@ export default function mergeOptions ( config, command ) {
input: getOption('input'),
legacy: getOption('legacy'),
treeshake: getOption('treeshake'),
acorn: config.acorn,
context: config.context,
moduleContext: config.moduleContext,
plugins: config.plugins,
onwarn: config.onwarn
};

// legacy, to ensure e.g. commonjs plugin still works
inputOptions.entry = inputOptions.input;

const commandExternal = ( command.external || '' ).split( ',' );
const configExternal = config.external;

Expand Down
2 changes: 1 addition & 1 deletion src/rollup/index.js
Expand Up @@ -68,7 +68,7 @@ function checkInputOptions ( options, warn ) {
throw new Error( 'The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://github.com/rollup/rollup/wiki/Plugins for details' );
}

if ( options.entry ) {
if ( options.entry && !options.input ) {
options.input = options.entry;
warn({
message: `options.entry is deprecated, use options.input`
Expand Down
14 changes: 12 additions & 2 deletions src/watch/index.js
Expand Up @@ -85,26 +85,36 @@ class Task {

this.inputOptions = {
input: config.input,
entry: config.input, // legacy, for e.g. commonjs plugin
legacy: config.legacy,
treeshake: config.treeshake,
plugins: config.plugins
plugins: config.plugins,
external: config.external,
onwarn: config.onwarn,
acorn: config.acorn,
context: config.context,
moduleContext: config.moduleContext
};

const baseOutputOptions = {
extend: config.extend,
exports: config.exports,
amd: config.amd,
banner: config.banner,
footer: config.footer,
intro: config.intro,
outro: config.outro,
sourcemap: config.sourcemap,
sourcemapFile: config.sourcemapFile,
name: config.name,
globals: config.globals,
interop: config.interop,
legacy: config.legacy,
indent: config.indent,
strict: config.strict,
noConflict: config.noConflict
noConflict: config.noConflict,
paths: config.paths,
preferConst: config.preferConst
};

this.outputs = ensureArray(config.output).map(output => {
Expand Down

0 comments on commit 0eb4fc1

Please sign in to comment.