Bundlers let us write modules that work in the browser
// this module depends on lodash
import _ from 'lodash';
// this is what this module exposes
export default someValue;
// this module depends on lodash
const _ = require('lodash');
// this is what this module exposes
module.exports = someValue;
// app.js
import {Component} from ‘react’;
import {Button} from ‘./button’;
export class App extends Component {
render() {
// ...
}
}
button.js
react
app.js
button.css
internal.js
entry.js
message.js
name.js
Visit https://github.com/ronami/minipack to see the code base with comments explaining every part of the talk