flippingbitss / react-daterange-picker

A react date range picker to using @material-ui. Live Demo: https://flippingbitss.github.io/react-daterange-picker/
MIT License
110 stars 212 forks source link

Building using Rollup failed #1

Open andre-rafa-b opened 4 years ago

andre-rafa-b commented 4 years ago

Hi,

first congrats for the job. It is a really nice react component. Although, I couldn't build my project using rollup.

Results bellow: (!)thishas been rewritten toundefined https://rollupjs.org/guide/en/#error-this-is-undefined node_modules\@matharumanpreet00\react-daterange-picker\build\index.js 1: "use strict"; 2: var __assign = (this && this.__assign) || function () { ^ 3: __assign = Object.assign || function(t) { 4: for (var s, i = 1, n = arguments.length; i < n; i++) { ...and 5 other occurrences [!] Error: 'DateRangePicker' is not exported by node_modules\@matharumanpreet00\react-daterange-picker\build\index.js https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module- src\Dashboards\Compras\index.jsx (2:9) 1: import React, { Component } from 'react'; 2: import { DateRangePicker, DateRange } from "@matharumanpreet00/react-daterange-picker"; ^ 3: 4: import ContratacoesPorPeriodo from 'ContratacoesPorPeriodo'; Error: 'DateRangePicker' is not exported by node_modules\@matharumanpreet00\react-daterange-picker\build\index.js

package.json: "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "rollup -c src/rollup.config.js --compact" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/core": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "rollup": "^1.17.0", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-node-resolve": "^5.2.0" }, "dependencies": { "@material-ui/core": "^4.3.0", "@matharumanpreet00/react-daterange-picker": "^1.0.5" }

flippingbitss commented 4 years ago

@andre-rafa-b Thanks. I haven't used rollup before, it looks like a module resolution problem, do you have config setup properly ? Maybe try this