/rollup-jsx-bug

Demonstrates usage tracking issue with Rollup and JSX

Primary LanguageJavaScript

Source

import React from "react"
import { FormattedMessage } from "react-intl"

export default function Hello() {
  return <FormattedMessage id="foo"/>
}

Bundle Actual

'use strict';

require('react');
require('react-intl');

function Hello() {
  return <FormattedMessage id="foo"/>
}

module.exports = Hello;

Bundle Expected

'use strict';

var React = require('react');

var reactIntl = require('react-intl');
var FormattedMessage = reactIntl.FormattedMessage;

function Hello() {
  return <FormattedMessage id="foo"/>
}

module.exports = Hello;