-
Notifications
You must be signed in to change notification settings - Fork 41
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 failed: 'Logger' is not exported by node_modules/angular2-logger/core.js #103
Comments
Have you tried this @olivermuc? https://github.com/rollup/rollup-plugin-commonjs#custom-named-exports |
Thx @langley-agm - will give it a shot shortly. |
I also have this problem and tried the rollup commonjs workaround, but now encounter this error: For some reason rollup is trying to parse a Typescript file from the core.js require. I don't know what to do about this. |
I must be doing something wrong, it's not working despite @olivermuc solution. Seems like it completely ignores 'namedExports'. Running 'rollup-plugin-commonjs' version '^8.0.0'. Anybody any clues? 'use strict';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve'
import uglify from 'rollup-plugin-uglify'
import chalk from 'chalk';
const seen = new Set();
if (!process.stderr.isTTY) {
chalk.enabled = false;
}
const warnSymbol = process.stderr.isTTY ? `Warning: ` : `Warning: `;
const stderr = console.error.bind(console);
const handleWarning = warning => {
const str = warning.toString();
if (seen.has(str)) {
return;
}
seen.add(str);
stderr(`${warnSymbol}${chalk.bold(warning.message)}`);
if (warning.url) {
stderr(chalk.cyan(warning.url));
}
if (warning.loc) {
stderr(`${warning.loc.file} (${warning.loc.line}:${warning.loc.column})`);
}
if (warning.frame) {
stderr(chalk.dim(warning.frame));
}
stderr('');
};
const warnFilter = /The 'this' keyword is equivalent to 'undefined'/;
export default {
entry: './dist/out-tsc/src/main-aot.js',
dest: 'aot/dist/build.min.js', // output a single application bundle
sourceMap: true,
sourceMapFile: 'aot/dist/build.min.js.map',
treeshake: true,
format: 'iife',
onwarn: warning => { // overwite the default warning function
const str = warning.toString();
if (warnFilter.test(str)) {
return;
}
handleWarning(warning);
},
plugins: [
nodeResolve({jsnext: true, module: true}),
commonjs({
include: [
'node_modules/rxjs/**',
],
namedExports: {
'node_modules/angular2-logger/core.js': ['Logger', 'Options']
}
}),
uglify()
]
} |
Following the install instructions & getting this with ionic 2:
The text was updated successfully, but these errors were encountered: