Tutorial by Examples

Create folder. Open it in command line. Run npm install webpack -g. Create 2 files: cats.js: var cats = ['dave', 'henry', 'martha']; module.exports = cats; app.js cats = require('./cats.js'); console.log(cats); Run in command line: webpack ./app.js app.bundle.js Now in folder will be fil...
Create folder. Open it in command line. Run npm install webpack -g. Create 2 files: cats.js: define(function(){ return ['dave', 'henry', 'martha']; }); app.js require(['./cats'],function(cats){ console.log(cats); }) Run in command line: webpack ./app.js app.bundle.js Now i...
as written in MDN at July 2016: This feature is not implemented in any browsers natively at this time. It is implemented in many transpilers, such as the Traceur Compiler, Babel or Rollup. So here is example with Babel loader for Webpack: Create folder. Add package.json file there: { &quo...
as written in [MDN][1] at July 2016: This feature is not implemented in any browsers natively at this time. It is implemented in many transpilers, such as the Traceur Compiler, Babel or Rollup. So here is example with Typescript loader for Webpack: //TODO Create simplified version of this ar...

Page 1 of 1