Skip to content

Commit

Permalink
Merge pull request #154 from TypeStrong/issue152
Browse files Browse the repository at this point in the history
Fix issue with html-webpack-plugin (#152)
  • Loading branch information
jbrantly committed Feb 10, 2016
2 parents e7acb60 + ce0b9dd commit cc4518b
Show file tree
Hide file tree
Showing 22 changed files with 462 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): {
var getCompilerOptionDiagnostics = true;

loader._compiler.plugin("after-compile", (compilation, callback) => {
// Don't add errors for child compilations
if (compilation.compiler.isChild()) {
callback();
return;
}

let stats = compilation.stats;

// handle all other errors. The basic approach here to get accurate error
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"escape-string-regexp": "^1.0.3",
"fs-extra": "^0.22.1",
"glob": "^6.0.3",
"html-webpack-plugin": "^2.8.1",
"mkdirp": "^0.5.1",
"mocha": "^2.1.0",
"rimraf": "^2.4.2",
Expand Down
1 change: 1 addition & 0 deletions test/html-webpack-plugin/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("hello");
51 changes: 51 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.6/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/******/ (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) {

console.log("hello");


/***/ }
/******/ ]);
9 changes: 9 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.6/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
</head>
<body>
<script src="bundle.js"></script></body>
</html>
12 changes: 12 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.6/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Asset Size Chunks Chunk Names
bundle.js 1.41 kB 0 [emitted] main
index.html 159 bytes [emitted]
chunk {0} bundle.js (main) 22 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 22 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 426 kB 0
chunk {0} index.html 412 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 356 bytes {0} [built]
[1] ./~/html-webpack-plugin/~/lodash/index.js 411 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
51 changes: 51 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.7/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/******/ (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) {

console.log("hello");


/***/ }
/******/ ]);
9 changes: 9 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.7/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
</head>
<body>
<script src="bundle.js"></script></body>
</html>
12 changes: 12 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.7/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Asset Size Chunks Chunk Names
bundle.js 1.41 kB 0 [emitted] main
index.html 159 bytes [emitted]
chunk {0} bundle.js (main) 22 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 22 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 426 kB 0
chunk {0} index.html 412 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 356 bytes {0} [built]
[1] ./~/html-webpack-plugin/~/lodash/index.js 411 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
51 changes: 51 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.8/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/******/ (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) {

console.log("hello");


/***/ }
/******/ ]);
52 changes: 52 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.8/bundle.transpiled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/******/ (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) {

"use strict";
console.log("hello");


/***/ }
/******/ ]);
9 changes: 9 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.8/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Webpack App</title>
</head>
<body>
<script src="bundle.js"></script></body>
</html>
12 changes: 12 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.8/output.transpiled.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Asset Size Chunks Chunk Names
bundle.js 1.43 kB 0 [emitted] main
index.html 159 bytes [emitted]
chunk {0} bundle.js (main) 36 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 36 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 426 kB 0
chunk {0} index.html 412 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 356 bytes {0} [built]
[1] ./~/html-webpack-plugin/~/lodash/index.js 411 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
12 changes: 12 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.8/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Asset Size Chunks Chunk Names
bundle.js 1.41 kB 0 [emitted] main
index.html 159 bytes [emitted]
chunk {0} bundle.js (main) 22 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 22 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 426 kB 0
chunk {0} index.html 412 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 356 bytes {0} [built]
[1] ./~/html-webpack-plugin/~/lodash/index.js 411 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
51 changes: 51 additions & 0 deletions test/html-webpack-plugin/expectedOutput-1.9/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/******/ (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) {

console.log("hello");


/***/ }
/******/ ]);
Loading

0 comments on commit cc4518b

Please sign in to comment.