First time using Rollup so excuse my noob question!
I'm getting this module resolution error while I don't see anything missing from the tutorial...
// rollup.config.js
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
export default {
entry: './src/client/App.jsx',
format: 'cjs',
plugins: [ json(), babel() ],
format: 'cjs',
dest: 'bundle.js' // equivalent to --output
};
// .babelrc
{
"presets": [
"react",
"es2015-rollup"
],
"plugins": [
"external-helpers"
]
}
$ rollup -c
Treating 'babel-polyfill' as external dependency
Treating 'react' as external dependency
Treating 'react-dom' as external dependency
Treating 'react-redux' as external dependency
Treating 'redux' as external dependency
Treating 'react-router' as external dependency
Treating 'react-router-redux' as external dependency
Treating 'redux-thunk' as external dependency
Treating 'lodash/lang/isEmpty' as external dependency
Could not resolve '../reducers' from /code/src/client/App.jsx
Error: Could not resolve '../reducers' from /code/src/client/App.jsx
at /usr/lib/node_modules/rollup/src/Bundle.js:256:41
at process._tickCallback (node.js:368:9)
at Function.Module.runMain (module.js:469:11)
at startup (node.js:136:18)
at node.js:963:3
Type rollup --help for help, or visit https://github.com/rollup/rollup/wiki
$ cd src/client/
$ ls
App.jsx normalize.scss
$ cat ../reducers/index.js
// Temporary reducer to verify state is working properly
import { combineReducers } from 'redux';
import API from './api';
import Experiments from './experiments';
import Device from './device';
export default combineReducers({
API,
Experiments,
Device,
});
Most helpful comment
https://github.com/rollup/rollup-plugin-node-resolve
https://github.com/rollup/rollup-plugin-commonjs