monet / monet.js

monet.js - Monadic types library for JavaScript
https://monet.github.io/monet.js/
MIT License
1.6k stars 114 forks source link

Rollup error - "is not exported by..." #227

Open moczniak opened 4 years ago

moczniak commented 4 years ago

i imported module by: import { Reader } from 'monet'; then got error: Error: 'Reader' is not exported by node_modules/monet/dist/monet.js

my config:

import resolve from 'rollup-plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';
import copy from 'rollup-plugin-copy';
import replace from '@rollup/plugin-replace';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import commonjs from '@rollup/plugin-commonjs';

const isDev = process.argv.includes('--dev');
const isServe = process.argv.includes('--serve');

export function getPlugins(envFrom, envTo, indexHtml) {
  return [
    ...(isDev ? [replace({ [envFrom]: envTo, delimiters: ['', ''] })] : []),
    resolve(),
    commonjs(),
    typescript(),
    ...(!isDev && !isServe
      ? [
          terser({
            output: {
              comments: false
            }
          })
        ]
      : []),
    copy({
      targets: [
        {
          src: indexHtml,
          dest: 'dist'
        }
      ]
    }),
    ...(isServe
      ? [
          serve({
            contentBase: 'dist',
            port: 4200
          }), // index.html should be in root of project
          livereload()
        ]
      : [])
  ];
}
ulfryk commented 4 years ago

@moczniak sorry for not answering for such a long time...

I don't use rollup, never did and don't have time to investigate rollup specific isues :(

Did you find any solution in meantime?