function OhHai() {
console.log('just checking code size')
}
These are the stickers I am associated with
|x|
var domEl = document.getElementById('app')
domEl.addEventListener('click', globalHandler)
globalBusinessLogicInit()
(function () {
window.App = App || {};
App.MyModule = App.MyModule || {};
})()
[Bow to Dojo & YUI goes here]
require
ddefine
define(
module_id /*optional*/,
[dependencies] /*optional*/,
definition function
/*function for instantiating the module or object*/
);
require([
module_id, /* optional */
module_id2, /* optional */
module_id3, /* optional */
])
module.exports
require
// module1.js
module.exports = () => 'Not Yet Implemented, sry'
// module2.js
const businessLogic = require('./module1.js')
~ node_modules
you know
import
export
// module1.es.js
export default function businessLogic() {}
export function namedFunction() {}
// module2.es.js
import Module1BusinessLogic from './module1.es';
import {namedFunction} from './module1.es';
text!
, css!
, whatever!
)~ some of those can be used with
more than one type of module
Similar to 'tasks' in build tools
import React from 'react';
import './some-styles.scss';
import {alien_functions} from 'alien.coffee';
Hook into compilation lifecycle
function CustomNotification(options) {}
CustomNotification.prototype.apply = function(compiler) {
compiler.plugin("done", () => {
console.log("\n--- Done compiling! ---\n");
});
};
module.exports = CustomNotification;
new webpack.ProvidePlugin({
'Promise': 'exports?global.Promise!es6-promise',
'fetch': 'exports?self.fetch!whatwg-fetch'
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin('[name].[contenthash].css'),