You can use this plugin for rollup-plugin-includepaths plugins .
It allows you to import modules by name and define modules that should be excluded from the package. I used it in rollup.config.js :
import babel from 'rollup-plugin-babel'; import includePaths from 'rollup-plugin-includepaths'; var includePathOptions = { paths: ['es6'], include: { 'd3': './global/js/' + 'base/d3.min' // include library in es6 modules }, external: ['d3'] // but don't bundle them into bundle.js }; export default { entry: './es6/entry.js', plugins: [ includePaths(includePathOptions), babel() ], format: 'amd', dest: 'build/bundle.js', sourceMap: true };
And in es6 modules:
// not using relative path since it is handled by the plugin import d3 from 'd3'; import other from 'otherModules'; //...
Read more about external resolution here.
source share