I\'m trying to play with Babel, but it doesn\'t work well for me.
My project is simple
|-project/
|---src/
|-----index.html
|-----main.js
|-----module.js
First, the browser say require is not defined, so I add require.js to my HTML.
I don't think, that adding require.js will be the solution. In this context require is node-style syntax: (https://github.com/substack/browserify-handbook#user-content-require).
Browserify is a module loader but works different than requirejs. There is a babel distribution for requirejs, too (https://github.com/mikach/requirejs-babel) but I recommend using browserify.
In a setup, where babel is working with browserify, something like this
import $ from'jquery';
will become something like this
var $ = require('jquery');