Commit beaae6b3 authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+7 −0
Changes for Module and Asset Bundling with webpack - Working Files/Chapter 1/complete 0104/client/js/app.js: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
var $ = require('jquery');

console.log('hello world');

$(function () {
  $(document.body).append('<div>').text('hello webpack');
});
+10 −0
Changes for Module and Asset Bundling with webpack - Working Files/Chapter 1/complete 0104/index.html: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Webpack Video</title>
  </head>
  <body>
    <script src="build/app-bundle.js"></script>
  </body>
</html>
+16 −0
Changes for Module and Asset Bundling with webpack - Working Files/Chapter 1/complete 0104/package.json: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "name": "webpack-config",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "webpack": "webpack --watch --progress --colors"
  },
  "author": "Adam Bretz",
  "license": "ISC",
  "dependencies": {
    "babel-polyfill": "6.2.x",
    "jquery": "2.1.x",
    "webpack": "1.12.x"
  }
}
+17 −0
Changes for Module and Asset Bundling with webpack - Working Files/Chapter 1/complete 0104/webpack.config.js: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
const config = {
  entry: {
    app: ['babel-polyfill','./client/js/app']
  },
  output: {
    path: './build',
    filename: '[name]-bundle.js'
  },
  devtool: 'source-map',
  module: {},
  resolve: {
    extension: ['', '.js'],
    modulesDirectories: ['node_modules']
  }
};

module.exports = config;
+14 −0
Changes for Module and Asset Bundling with webpack - Working Files/Chapter 1/complete 0105/client/js/app.js: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
class Person {
  constructor(name, age) {
    Object.assign(this, { name, age });
  }
}

const man = new Person('walter white', 52);
const {name, age} = man;

console.log(`${name} is ${age} years old!`);

const view = require('raw!jade-html?pretty=false!../views/index.jade');
console.log(view);
document.body.innerHTML = view;
Loading