broswerify in babel file watcher

I have been following this guide to compile es6 code. I set up a babel file watcher as per the guideline but getting `Uncaught ReferenceError: require` error in my script. I know browserify can solve the problem but can it be incorporated into the babel watcher?

file watcher config:

Program : /home/something/node_modules/.bin/babel
Arguments :$FileDir$ --source-maps --out-dir /shop/js/build
Working directory: $ProjectFileDir$

.barbel.rc:

{
"presets" : ["es2015","react"],
"plugins": [
"transform-member-expression-literals",
"transform-property-literals",
"transform-merge-sibling-variables",
"transform-minify-booleans",
"transform-simplify-comparison-operators"
]
}



import App from 'grommet/components/App';
import Header from 'grommet/components/Header';
import Footer from 'grommet/components/Footer';
import Title from 'grommet/components/Title';
import TodoAppDashboard from './components/TodoAppDashboard';
class ItemPage extends React.Component {
render () {
return (
<App centered={false}>
<Header direction="row" justify="between" large={true}
pad={{horizontal: 'medium'}}>
<Title>Todo App</Title>
</Header>
<TodoAppDashboard />
<Footer primary={true} appCentered={true} direction="column"
align="center" pad="small" colorIndex="grey-1">
<p>
Builgfjd your ideas with <a href="http://grommet.io" target="_blank">Grommet</a>!
</p>
</Footer>
</App>
);
}
};
2 comments
Comment actions Permalink

Error doesn't seem to have any relation to file watcher. Do you bundle compiled code with Browserify? If yes, what you do exactly, what file is being executed? Sample project would be helpful

0

Please sign in to leave a comment.