import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
const pkg = require(process.env.PWD+'/package.json');
if(!pkg.dependencies) pkg.dependencies={};

const config = {
	input: process.env.PWD+'/src/index.js',
	output: [{
		format: 'cjs',
		dir: 'cjs',
		preferConst: true,
		interop: false,
		freeze: false,
		strict: false
	}],
	external: [
		...require('module').builtinModules,
	],
    plugins: [
        commonjs(),
        nodeResolve({
            moduleDirectories: [process.env.PWD],
        }),
    ],
}

export default config;
