Hi, I have been burning a lot of time with the new rollup bundling which seems very buggy. I am stuck on underscore. I followed your steps but get
underscore.js does not export default
when I try and use underscore
which kind of reads like _ is not the default export. Any ideas ?
Example component
import { Component } from ‘@angular/core’;
import _ from ‘underscore’;
@Component({
selector: ‘testchart’,
templateUrl: ‘testchart.html’
})
export class Testchart {
options: HighchartsOptions;
constructor() {
debugger;
console.log( .uniq([1, 1, 2, 3, 5, 5, 6]) );
//console.log(.uniq([1, 1, 2, 3, 5, 5, 6]));
this.options = {
chart: {
type: 'pie'
},
series: [{
name: 'Brands',
data: [{
name: 'Microsoft Internet Explorer',
y: 100
}]
}]
}
}
}
And package.json
{
“name”: “ionic-hello-world”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“build”: “ionic-app-scripts build”,
“watch”: “ionic-app-scripts watch”,
“serve:before”: “watch”,
“emulate:before”: “build”,
“deploy:before”: “build”,
“build:before”: “build”,
“run:before”: “build”
},
“dependencies”: {
"@ionic/storage": “1.1.2”,
"@types/underscore": “1.7.33”,
“angular2-highcharts”: “^0.3.4”,
“angular2-moment”: “^1.0.0-beta.3”,
“highcharts”: “^5.0.0”,
“ionic-angular”: “^2.0.0-rc.0”,
“ionic-native”: “^2.0.3”,
“ionicons”: “^3.0.0”,
“moment”: “^2.15.1”,
“underscore”: “^1.8.3”
},
“devDependencies”: {
"@ionic/app-scripts": “latest”,
“typescript”: “^2.0.3”
},
“description”: “MyApp: An Ionic project”,
“cordovaPlugins”: [
“cordova-plugin-device”,
“cordova-plugin-console”,
“cordova-plugin-whitelist”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”
],
“config”: {
“ionic_rollup”: “./rollup.config.js”
},
“cordovaPlatforms”: []
}