import { babel } from '@rollup/plugin-babel';

const map = {
	"device": "./device/kaios.js",
	"store": "./lib/store.js"
}

const config = {
	input: 'src/index.js',
	output: {
		dir: 'build',
		format: 'iife'
	},
	plugins: [
		babel({
			babelHelpers: 'bundled',
			presets: [
				[
					"@babel/preset-env",
					{
						"targets": {
							"firefox": "48"
						},
						"modules": false
					}
				]
			]
		}),
		{
			resolveId(n) {
				if(map[n])
					return map[n]
			}
		}
	]
};

export default config;