Skip to content
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

Can't seem to get to work with rollup #114

Closed
balupton opened this issue Apr 22, 2016 · 2 comments · Fixed by #115
Closed

Can't seem to get to work with rollup #114

balupton opened this issue Apr 22, 2016 · 2 comments · Fixed by #115

Comments

@balupton
Copy link

balupton commented Apr 22, 2016

Script:

$ nake build:scripts

> rollup -c ./config/rollup.js

Module /Users/balupton/Projects/configurator2/node_modules/react-refetch/lib/index.js does not export PromiseState (imported by /Users/balupton/Projects/configurator2/client/configurator-loader.js)
Error: Module /Users/balupton/Projects/configurator2/node_modules/react-refetch/lib/index.js does not export PromiseState (imported by /Users/balupton/Projects/configurator2/client/configurator-loader.js)
    at Module.trace (/Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Module.js:626:30)
    at /Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Module.js:200:35
    at Array.forEach (native)
    at /Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Module.js:197:25
    at Array.forEach (native)
    at Module.bindAliases (/Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Module.js:186:29)
    at /Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Bundle.js:81:44
    at Array.forEach (native)
    at /Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/src/Bundle.js:81:18
    at tryCatch (/Users/balupton/Projects/configurator2/node_modules/rollup/www/ROLLUP/rollup/node_modules/es6-promise/lib/es6-promise/-internal.js:185:12)

Config:

import uglify from 'rollup-plugin-uglify'
import babel from 'rollup-plugin-babel'
import npm from 'rollup-plugin-npm'
import commonjs from 'rollup-plugin-commonjs'
import inject from 'rollup-plugin-inject'

const config = require('./')
const join = require('path').join

export default {
    entry: config.clientScriptPath,
    format: 'iife',
    sourceMap: config.production ? false : 'inline',
    plugins: [
        npm(),
        commonjs({include: 'node_modules/**'}),
        babel({
            exclude: 'node_modules/**'
        }),
        inject({
            include: 'node_modules/**',
            react: join(config.rootPath, 'node_modules', 'react', 'dist', 'react.min.js'),
            'react-dom': join(config.rootPath, 'node_modules', 'react-dom', 'dist', 'react-dom.min.js')
        }),
        uglify()
    ],
    dest: config.assetsScriptPath
}

Usage:

import {connect, PromiseState} from 'react-refetch'
@balupton
Copy link
Author

@ryanbrainard
Copy link
Contributor

Perhaps we should change to this style:
https://github.com/reactjs/react-redux/blob/master/src/index.js
I can test it out and push up a branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants