import { Media } from 'react-fns`'
<Media.default>
</Media.default>
import eslint from 'rollup-plugin-eslint';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import commonjs from 'rollup-plugin-commonjs';
const pkg = require('./package.json');
const external = Object.keys({
...pkg.dependencies,
...pkg.devDependencies,
...pkg.peerDependencies,
});
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs',
sourceMap: true,
},
{
file: pkg.module,
format: 'es',
sourceMap: true,
},
],
external,
plugins: [
resolve(), // resolve external modules from npm
eslint({
exclude: '/node_modules/**',
}),
babel({
exclude: '/node_modules/**', // only transpile our source code
}),
commonjs({
'/node_modules/color/index': ['color'],
}),
process.env.NODE_ENV === 'production' && terser(),
],
};
Also, create-react-app seems to import correctly. Any suggestions on modifying my rollup setup so as to NOT have to use default
.