Browse Source

Merge pull request #812 from rollup/disable-indent

Change indent default to false
rollup-init
Rich Harris 8 years ago
committed by GitHub
parent
commit
66cb9ad290
  1. 2
      src/utils/getIndentString.js
  2. 2
      test/cli/banner-intro-outro-footer/_config.js
  3. 2
      test/cli/module-name/_config.js
  4. 2
      test/cli/no-strict/_config.js
  5. 2
      test/cli/no-treeshake/_config.js
  6. 6
      test/test.js

2
src/utils/getIndentString.js

@ -1,5 +1,5 @@
export default function getIndentString ( magicString, options ) { export default function getIndentString ( magicString, options ) {
if ( !( 'indent' in options ) || options.indent === true ) { if ( options.indent === true ) {
return magicString.getIndentString(); return magicString.getIndentString();
} }

2
test/cli/banner-intro-outro-footer/_config.js

@ -1,4 +1,4 @@
module.exports = { module.exports = {
description: 'adds banner/intro/outro/footer', description: 'adds banner/intro/outro/footer',
command: 'rollup -i main.js -f iife --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"' command: 'rollup -i main.js -f iife --indent --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"'
}; };

2
test/cli/module-name/_config.js

@ -1,4 +1,4 @@
module.exports = { module.exports = {
description: 'generates UMD export with correct moduleName', description: 'generates UMD export with correct moduleName',
command: 'rollup main.js --format umd --name myBundle' command: 'rollup main.js --format umd --name myBundle --indent'
}; };

2
test/cli/no-strict/_config.js

@ -1,4 +1,4 @@
module.exports = { module.exports = {
description: 'use no strict option', description: 'use no strict option',
command: 'rollup -i main.js -f iife --no-strict' command: 'rollup -i main.js -f iife --no-strict --indent'
}; };

2
test/cli/no-treeshake/_config.js

@ -1,4 +1,4 @@
module.exports = { module.exports = {
description: 'generates IIFE export with all code', description: 'generates IIFE export with all code',
command: 'rollup main.js --format iife --name shakeless --no-treeshake' command: 'rollup main.js --format iife --name shakeless --no-treeshake --indent'
}; };

6
test/test.js

@ -274,6 +274,12 @@ describe( 'rollup', function () {
const config = loadConfig( FORM + '/' + dir + '/_config.js' ); const config = loadConfig( FORM + '/' + dir + '/_config.js' );
if ( config.skipIfWindows && process.platform === 'win32' ) return; if ( config.skipIfWindows && process.platform === 'win32' ) return;
if ( !config.options ) {
config.options = {};
}
if ( !( 'indent' in config.options ) ) {
config.options.indent = true;
}
const options = extend( {}, { const options = extend( {}, {
entry: FORM + '/' + dir + '/main.js', entry: FORM + '/' + dir + '/main.js',

Loading…
Cancel
Save