Files
windycoys/rollup.config.js
2019-01-09 15:32:50 +00:00

36 lines
939 B
JavaScript

const { resolve } = require('path');
const babel = require('rollup-plugin-babel');
const uglify = require('rollup-plugin-uglify');
const pkg = require('./package.json');
const year = new Date().getFullYear();
const production = process.env.NODE_ENV === 'production';
module.exports = {
input: resolve(__dirname, 'js/index.js'),
output: {
file: resolve(__dirname, 'theme/bundle.js'),
format: 'umd',
name: 'windy',
sourcemap: !production && 'inline',
banner: `/**!
* Theme Name: WindyCOYS
* Theme URI: https://github.com/danhead/windycoys/
* Author: ${pkg.author}
* Author URI: https://danielhead.com
* Description: Theme for windycoys.com
* Version: ${pkg.version}
* Copyright: (c) ${year} ${pkg.author}
* License: MIT
* License URI: https://choosealicense.com/licenses/mit/
*/`,
},
plugins: [
babel({
exclude: 'node_modules/**',
}),
production && uglify(),
].filter(Boolean),
};