From f616f2e22fb3d6df1ec61daac8b65e2d0ca78504 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 23 Mar 2016 10:07:26 +0100 Subject: [PATCH] Add inlining --- CHANGELOG.md | 5 +++ examples/inline/dist/bundle.js | 60 +++++++++++++++++++++++++++++ examples/inline/dist/favicon.ico | Bin 0 -> 766 bytes examples/inline/dist/index.html | 62 ++++++++++++++++++++++++++++++ examples/inline/dist/styles.css | 3 ++ examples/inline/example.js | 4 ++ examples/inline/favicon.ico | Bin 0 -> 766 bytes examples/inline/main.css | 3 ++ examples/inline/readme.md | 4 ++ examples/inline/template.jade | 10 +++++ examples/inline/webpack.config.js | 26 +++++++++++++ index.js | 6 ++- lib/loader.js | 1 + package.json | 2 +- 14 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 examples/inline/dist/bundle.js create mode 100644 examples/inline/dist/favicon.ico create mode 100644 examples/inline/dist/index.html create mode 100644 examples/inline/dist/styles.css create mode 100755 examples/inline/example.js create mode 100644 examples/inline/favicon.ico create mode 100644 examples/inline/main.css create mode 100644 examples/inline/readme.md create mode 100644 examples/inline/template.jade create mode 100755 examples/inline/webpack.config.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7a5e4..732d868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Change History ============== +v2.14.0 +---- +* Export publicPath to the template +* Add example for inlining css and js + v2.13.0 ---- * Add support for absolute output file names diff --git a/examples/inline/dist/bundle.js b/examples/inline/dist/bundle.js new file mode 100644 index 0000000..8387058 --- /dev/null +++ b/examples/inline/dist/bundle.js @@ -0,0 +1,60 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + __webpack_require__(1); + + console.log('Hello World'); + + +/***/ }, +/* 1 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/examples/inline/dist/favicon.ico b/examples/inline/dist/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..be74abd69ad6a32de7375df13cab9354798e328f GIT binary patch literal 766 zcmc(dze~eV5XUd2fg&jH87YDYDQKxq1{4b-_ydP-wqS9vgGh17QXQQAwOE{VaBvi* zmu^z9t({y-&1ey8Y_x;?x+`BviV9;aRjMgZ8M*!jgkRrFqSI9;F zHyfX@Az|AvVmn~YWWZP`0&JWEY~BFm?*Vq}VD7&_%x%MP$p`D`4JMC!K|B7pt?Mmp zUJAB7rxMXS6=!P+AtLU9V)J#61WPxwipRXCHO{BJ`l{m53#=t97a!znv~vfmr|AaP zRGIT7#0FyJy3Z*hL{GQp-0TRhX8UzZ)+>%?mK0^goaX4Q;xJade demo \ No newline at end of file diff --git a/examples/inline/dist/styles.css b/examples/inline/dist/styles.css new file mode 100644 index 0000000..232a2cd --- /dev/null +++ b/examples/inline/dist/styles.css @@ -0,0 +1,3 @@ +body { + background: snow; +} \ No newline at end of file diff --git a/examples/inline/example.js b/examples/inline/example.js new file mode 100755 index 0000000..74b36f7 --- /dev/null +++ b/examples/inline/example.js @@ -0,0 +1,4 @@ +'use strict'; +require('./main.css'); + +console.log('Hello World'); diff --git a/examples/inline/favicon.ico b/examples/inline/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..be74abd69ad6a32de7375df13cab9354798e328f GIT binary patch literal 766 zcmc(dze~eV5XUd2fg&jH87YDYDQKxq1{4b-_ydP-wqS9vgGh17QXQQAwOE{VaBvi* zmu^z9t({y-&1ey8Y_x;?x+`BviV9;aRjMgZ8M*!jgkRrFqSI9;F zHyfX@Az|AvVmn~YWWZP`0&JWEY~BFm?*Vq}VD7&_%x%MP$p`D`4JMC!K|B7pt?Mmp zUJAB7rxMXS6=!P+AtLU9V)J#61WPxwipRXCHO{BJ`l{m53#=t97a!znv~vfmr|AaP zRGIT7#0FyJy3Z*hL{GQp-0TRhX8UzZ)+>%?mK0^goaX4Q;x