Last active
May 30, 2016 20:21
-
-
Save qrg/907d7c28ef776ad1beee1eaf6e42e702 to your computer and use it in GitHub Desktop.
sourcemaps does not work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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') | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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