diff --git a/.travis.yml b/.travis.yml
index cae6ac14..9dbf513b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ env:
- WEBPACK_VERSION=1 EXTRACT_PLUGIN_VERSION=1
- WEBPACK_VERSION=2 EXTRACT_PLUGIN_VERSION=2
- WEBPACK_VERSION=3 EXTRACT_PLUGIN_VERSION=3.0.0-beta.3
+ - WEBPACK_VERSION=4.0.0-beta.1 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0
before_install:
- stty columns 120
install:
@@ -14,5 +15,14 @@ install:
- npm rm webpack
- npm rm extract-text-webpack-plugin
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION --ignore-scripts || true
+matrix:
+ exclude:
+ - env: WEBPACK_VERSION=4.0.0-beta.1 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0
+ node_js: "4"
+ - env: WEBPACK_VERSION=4.0.0-beta.1 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0
+ node_js: "5"
+ include:
+ - env: WEBPACK_VERSION=4.0.0-beta.1 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0
+ node_js: "8"
script:
- npm test
diff --git a/examples/appcache/dist/webpack-4/0714810ae3fb211173e2964249507195.png b/examples/appcache/dist/webpack-4/0714810ae3fb211173e2964249507195.png
new file mode 100644
index 00000000..d71b3d78
Binary files /dev/null and b/examples/appcache/dist/webpack-4/0714810ae3fb211173e2964249507195.png differ
diff --git a/examples/appcache/dist/webpack-4/bundle.js b/examples/appcache/dist/webpack-4/bundle.js
new file mode 100644
index 00000000..53bdab35
--- /dev/null
+++ b/examples/appcache/dist/webpack-4/bundle.js
@@ -0,0 +1,92 @@
+/******/ (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] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = 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;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+__webpack_require__(4);
+var h1 = document.createElement('h1');
+h1.innerHTML = 'Hello world!';
+document.body.appendChild(h1);
+
+
+/***/ }),
+/* 1 */,
+/* 2 */,
+/* 3 */,
+/* 4 */
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ })
+/******/ ]);
\ No newline at end of file
diff --git a/examples/appcache/dist/webpack-4/index.html b/examples/appcache/dist/webpack-4/index.html
new file mode 100644
index 00000000..536e8a47
--- /dev/null
+++ b/examples/appcache/dist/webpack-4/index.html
@@ -0,0 +1 @@
+
Example template
\ No newline at end of file
diff --git a/examples/appcache/dist/webpack-4/manifest.appcache b/examples/appcache/dist/webpack-4/manifest.appcache
new file mode 100644
index 00000000..3345da36
--- /dev/null
+++ b/examples/appcache/dist/webpack-4/manifest.appcache
@@ -0,0 +1,9 @@
+CACHE MANIFEST
+# 95a89258cd32fe3f01e3
+
+0714810ae3fb211173e2964249507195.png
+bundle.js
+styles.css
+
+NETWORK:
+*
diff --git a/examples/appcache/dist/webpack-4/styles.css b/examples/appcache/dist/webpack-4/styles.css
new file mode 100644
index 00000000..232a2cdb
--- /dev/null
+++ b/examples/appcache/dist/webpack-4/styles.css
@@ -0,0 +1,3 @@
+body {
+ background: snow;
+}
\ No newline at end of file
diff --git a/examples/build-examples.js b/examples/build-examples.js
index adf81ebe..f4f0f9cb 100644
--- a/examples/build-examples.js
+++ b/examples/build-examples.js
@@ -30,8 +30,23 @@ examples.forEach(function (exampleName) {
var examplePath = path.join(__dirname, exampleName);
var configFile = path.join(examplePath, 'webpack.config.js');
+ var config = require(configFile);
+ if (webpackMajorVersion === '4') {
+ config.plugins.unshift(new webpack.LoaderOptionsPlugin({
+ options: {
+ context: process.cwd() // or the same value as `context`
+ }
+ }));
+ config.mode = 'production';
+ config.optimization = { minimizer: [] };
+ if (config.module && config.module.loaders) {
+ config.module.rules = config.module.loaders;
+ delete config.module.loaders;
+ }
+ }
+
rimraf.sync(path.join(examplePath, 'dist', 'webpack-' + webpackMajorVersion));
- webpack(require(configFile), function (err, stats) {
+ webpack(config, function (err, stats) {
if (err) {
console.error(err.stack || err);
if (err.details) {
diff --git a/examples/custom-template/dist/webpack-4/0714810ae3fb211173e2964249507195.png b/examples/custom-template/dist/webpack-4/0714810ae3fb211173e2964249507195.png
new file mode 100644
index 00000000..d71b3d78
Binary files /dev/null and b/examples/custom-template/dist/webpack-4/0714810ae3fb211173e2964249507195.png differ
diff --git a/examples/custom-template/dist/webpack-4/bundle.js b/examples/custom-template/dist/webpack-4/bundle.js
new file mode 100644
index 00000000..53bdab35
--- /dev/null
+++ b/examples/custom-template/dist/webpack-4/bundle.js
@@ -0,0 +1,92 @@
+/******/ (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] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = 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;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+__webpack_require__(4);
+var h1 = document.createElement('h1');
+h1.innerHTML = 'Hello world!';
+document.body.appendChild(h1);
+
+
+/***/ }),
+/* 1 */,
+/* 2 */,
+/* 3 */,
+/* 4 */
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ })
+/******/ ]);
\ No newline at end of file
diff --git a/examples/custom-template/dist/webpack-4/index.html b/examples/custom-template/dist/webpack-4/index.html
new file mode 100644
index 00000000..d68bf441
--- /dev/null
+++ b/examples/custom-template/dist/webpack-4/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+ Webpack App
+
+
+
+ Partial
+
+
+
diff --git a/examples/custom-template/dist/webpack-4/styles.css b/examples/custom-template/dist/webpack-4/styles.css
new file mode 100644
index 00000000..232a2cdb
--- /dev/null
+++ b/examples/custom-template/dist/webpack-4/styles.css
@@ -0,0 +1,3 @@
+body {
+ background: snow;
+}
\ No newline at end of file
diff --git a/examples/default/dist/webpack-4/bundle.js b/examples/default/dist/webpack-4/bundle.js
new file mode 100644
index 00000000..93e99b50
--- /dev/null
+++ b/examples/default/dist/webpack-4/bundle.js
@@ -0,0 +1,420 @@
+/******/ (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] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = 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;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 4);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports) {
+
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+var stylesInDom = {},
+ memoize = function(fn) {
+ var memo;
+ return function () {
+ if (typeof memo === "undefined") memo = fn.apply(this, arguments);
+ return memo;
+ };
+ },
+ isOldIE = memoize(function() {
+ return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase());
+ }),
+ getHeadElement = memoize(function () {
+ return document.head || document.getElementsByTagName("head")[0];
+ }),
+ singletonElement = null,
+ singletonCounter = 0,
+ styleElementsInsertedAtTop = [];
+
+module.exports = function(list, options) {
+ if(typeof DEBUG !== "undefined" && DEBUG) {
+ if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
+ }
+
+ options = options || {};
+ // Force single-tag solution on IE6-9, which has a hard limit on the # of