2017-06-08 00:20:48 +02:00
|
|
|
import baseConfig from './rollup.base.config.js';
|
2017-01-11 10:22:12 -08:00
|
|
|
import resolve from 'rollup-plugin-node-resolve';
|
|
|
|
|
import commonjs from 'rollup-plugin-commonjs';
|
2017-01-23 18:10:51 +01:00
|
|
|
import globals from 'rollup-plugin-node-globals';
|
2017-01-18 14:24:42 -08:00
|
|
|
import json from 'rollup-plugin-json';
|
2017-01-11 10:22:12 -08:00
|
|
|
|
2017-05-31 13:37:35 -07:00
|
|
|
const filepath = process.env.filepath;
|
|
|
|
|
const filename = filepath.replace(/.+\//, '');
|
|
|
|
|
const basename = filename.replace(/\..+/, '');
|
|
|
|
|
|
2017-06-08 00:20:48 +02:00
|
|
|
export default Object.assign(baseConfig, {
|
2017-05-31 13:37:35 -07:00
|
|
|
entry: 'dist/' + filepath,
|
2017-06-14 02:20:13 +10:00
|
|
|
dest: 'docs/lib/' + filename,
|
2017-01-11 10:22:12 -08:00
|
|
|
format: 'iife',
|
2017-06-08 00:20:48 +02:00
|
|
|
plugins: [json(), resolve({ preferBuiltins: true }), commonjs(), globals()],
|
2017-01-11 10:22:12 -08:00
|
|
|
useStrict: false,
|
2017-05-31 13:37:35 -07:00
|
|
|
moduleName: basename.replace(/.+-/, ''),
|
2017-06-08 00:20:48 +02:00
|
|
|
external: ['assert', 'fs', 'module'],
|
|
|
|
|
});
|