angular - " warning.indexOf is not a function" rollup.js -
am getting below error message rollup.config.js file
� warning.indexof not function
rollup.config.js
import noderesolve 'rollup-plugin-node-resolve' import commonjs 'rollup-plugin-commonjs'; import uglify 'rollup-plugin-uglify' //paths relative execution path export default { entry: 'src/main-aot.js', dest: 'aot/dist/build.js', // output single application bundle sourcemap: true, sourcemapfile: 'aot/dist/build.js.map', format: 'iife', onwarn: function (warning) { // skip warnings // should intercept ... doesn't in rollup versions if (warning.code === 'this_is_undefined') { return; } // intercepts in rollup versions if (warning.indexof("the 'this' keyword equivalent 'undefined'") > -1) { return; } if (warning.indexof("use of `eval` ") > -1) { return; } // console.warn else console.warn(warning.message); }, plugins: [ noderesolve({ jsnext: true, module: true }), commonjs({ include: 'node_modules/rxjs/**', }), uglify() ] }
pacakge.json
"rollup": "^0.41.6", "rollup-plugin-commonjs": "^8.0.2", "rollup-plugin-node-resolve": "^3.0.0", "rollup-plugin-uglify": "^1.0.1",
it seems warning rather object string. changed line .indexof statement folling:
if ( warning.message.indexof("the 'this' keyword equivalent 'undefined'") > -1 ) { return; }
so error avoided, don't know whether correct solution. because when try rollup angular2 app i'm getting several error of "not exported". can give try, maybe helps you.
Comments
Post a Comment