Skip to content

Instantly share code, notes, and snippets.

@qrg
Last active May 30, 2016 20:21
Show Gist options
  • Select an option

  • Save qrg/907d7c28ef776ad1beee1eaf6e42e702 to your computer and use it in GitHub Desktop.

Select an option

Save qrg/907d7c28ef776ad1beee1eaf6e42e702 to your computer and use it in GitHub Desktop.
sourcemaps does not work
import {rollup} from 'rollup';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import jsx from 'rollup-plugin-jsx';
import babel from 'rollup-plugin-babel';
import {js, server} from '../config';
export default function () {
return rollup({
entry: js.src.path,
plugins: [
babel({
babelrc: false,
presets: ['es2015-rollup', 'react'],
exclude: 'node_modules/**'
}),
replace({
'process.env.NODE_ENV': JSON.stringify( 'production' )
}),
commonjs({
include: 'node_modules/**',
sourceMap: true
}),
nodeResolve({
main: true
}),
jsx({
factory: 'React.createElement',
sourceMap: true
})
]
}).then(bundle => {
return bundle.write({
dest: js.dest.path,
sourceMap: true,
format: 'iife'
});
}).catch(error => {
console.error(error);
});
}
'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
import module from './module';
console.log('entry.jsx');
module();
const CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
ReactDOM.render(
<CommentBox />,
document.querySelector('.js-main-container')
);
'use strict';
export default function () {
console.log('module.js');
debugger;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment