Comparing version 0.15.5 to 0.16.0-rc.1
@@ -14,4 +14,5 @@ 'use strict'; | ||
entry: './src/index.js', | ||
exports: options.exports, | ||
format: ['cjs'] | ||
format: ['cjs'], | ||
outDir: './dist', | ||
name: 'index' | ||
}, userConfig, options); | ||
@@ -18,0 +19,0 @@ |
@@ -29,2 +29,3 @@ 'use strict'; | ||
if (pkg.name) bili.name = pkg.name; | ||
bili.pkg = pkg; | ||
return bili; | ||
@@ -31,0 +32,0 @@ } catch (err) { |
@@ -91,4 +91,29 @@ 'use strict'; | ||
var banner = void 0; | ||
if (options.banner) { | ||
if (typeof options.banner === 'string') { | ||
banner = options.banner; | ||
} else { | ||
var pkg = typeof options.banner === 'object' ? _extends({}, options.pkg, options.banner) : options.pkg; | ||
var name = pkg.name; | ||
var version = pkg.version ? `v${pkg.version}` : ''; | ||
var year = pkg.year || new Date().getFullYear(); | ||
var author = typeof pkg.author === 'string' ? pkg.author : typeof pkg.author === 'object' ? (0, _stringifyAuthor2.default)(pkg.author) : ''; | ||
author = author ? author : ''; | ||
var license = pkg.license || ''; | ||
banner = '/*!\n' + ` * ${name} ${version}\n` + ` * (c) ${year}-present ${author}\n` + (license && ` * Released under the ${license} License.\n`) + ' */'; | ||
} | ||
} | ||
if (compress) { | ||
plugins.push(require('rollup-plugin-uglify')()); | ||
plugins.push(require('rollup-plugin-uglify')({ | ||
output: { | ||
// Preserve banner | ||
preamble: banner | ||
} | ||
})); | ||
} | ||
@@ -122,3 +147,4 @@ | ||
moduleName, | ||
external | ||
external, | ||
banner | ||
}; | ||
@@ -139,2 +165,6 @@ }; | ||
var _stringifyAuthor = require('stringify-author'); | ||
var _stringifyAuthor2 = _interopRequireDefault(_stringifyAuthor); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -145,4 +175,4 @@ | ||
function getDest(options, format, compress) { | ||
var name = options.name || 'index'; | ||
var dir = options.outDir || './dist'; | ||
var name = options.name; | ||
var dir = options.outDir; | ||
var suffix = '.js'; | ||
@@ -149,0 +179,0 @@ if (format === 'cjs') { |
@@ -26,3 +26,3 @@ 'use strict'; | ||
cli.option('config, c', 'Path to config file').option('watch, w', 'Run in watch mode').option('name, n', 'The filename of output file, no extension').option('out-dir, d', 'The output directory').option('format', 'Bundle format, array of string').option('module-name', 'The module name for UMD builds').option('map', 'Generate sourcemap, boolean or `inline`').option('compress', 'Generate a UMD bundle and compress it with sourcemaps').option('skip', 'Exclude specfic modules in node_modules dir from bundled file').option('es-module', 'Respect `jsnext:main` and `module` field in package.json').option('browser', 'Respect `browser` field in package.json').option('alias', 'Set option for rollup-plugin-alias').option('replace', 'Set option for rollup-plugin-replace').option('flow', 'Remove flow type annotations').option('exports', 'Specific what export mode to use, `default` or `named`').option('resolve', 'Resolve external dependencies'); | ||
cli.option('config, c', 'Path to config file').option('watch, w', 'Run in watch mode').option('name, n', 'The filename of output file, no extension').option('out-dir, d', 'The output directory').option('format', 'Bundle format, array of string').option('module-name', 'The module name for UMD builds').option('map', 'Generate sourcemap, boolean or `inline`').option('compress', 'Generate a UMD bundle and compress it with sourcemaps').option('skip', 'Exclude specfic modules in node_modules dir from bundled file').option('es-module', 'Respect `jsnext:main` and `module` field in package.json').option('browser', 'Respect `browser` field in package.json').option('alias', 'Set option for rollup-plugin-alias').option('replace', 'Set option for rollup-plugin-replace').option('flow', 'Remove flow type annotations').option('exports', 'Specific what export mode to use, `default` or `named`').option('resolve', 'Resolve external dependencies').option('banner', 'Content to insert to the top of bundle file, boolean or string or object'); | ||
@@ -29,0 +29,0 @@ cli.command('*', 'Bundle with bili', function (input, flags) { |
{ | ||
"name": "bili", | ||
"version": "0.15.5", | ||
"version": "0.16.0-rc.1", | ||
"description": "Transpile ESnext code with Rollup and Buble.", | ||
@@ -16,4 +16,4 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "BABEL_ENV=test jest --env node && xo src/*.js && npm run build", | ||
"test:cov": "BABEL_ENV=test jest --env node --coverage && xo src/*.js", | ||
"test": "cross-env BABEL_ENV=test jest --env node && xo src/*.js && npm run build", | ||
"test:cov": "cross-env BABEL_ENV=test jest --env node --coverage && xo src/*.js", | ||
"build": "babel src --out-dir lib", | ||
@@ -40,2 +40,3 @@ "dev": "babel src --out-dir lib --watch" | ||
"babel-preset-stage-2": "^6.24.1", | ||
"cross-env": "^5.0.0", | ||
"eslint-config-rem": "^3.1.0", | ||
@@ -69,2 +70,3 @@ "fs-extra": "^3.0.1", | ||
"rollup-watch": "^2.5.0", | ||
"stringify-author": "^0.1.3", | ||
"switchy": "^0.1.0", | ||
@@ -71,0 +73,0 @@ "update-notifier": "^2.1.0" |
18026
309
20
10
+ Addedstringify-author@^0.1.3
+ Addedstringify-author@0.1.3(transitive)