Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
moczniak opened this issue Feb 11, 2020 · 2 comments
Open

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

moczniak opened this issue Feb 11, 2020 · 2 comments
Assignees
Labels

Comments

@moczniak
Copy link

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 ulfryk self-assigned this May 5, 2020
@ulfryk
Copy link
Member

ulfryk commented May 5, 2020

@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?

@ulfryk ulfryk added the question label May 5, 2020
@ulfryk
Copy link
Member

ulfryk commented Nov 19, 2024

@moczniak please see #258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants