From 6e115519c1f0ff1f66df4917039a657d62b12d85 Mon Sep 17 00:00:00 2001 From: vagusX Date: Sat, 17 Mar 2018 13:43:18 +0800 Subject: [PATCH] feat: `getCustomTransformers` support path string for a module (#745) * feat: `getCustomTransformers` support path string for a module * feat: add test case and update readme --- README.md | 1 + src/instances.ts | 28 +++++- src/interfaces.ts | 4 +- .../customTransformerUsingPathString/app.ts | 2 + .../customerTransformers.js | 5 ++ .../expectedOutput-2.3/bundle.js | 78 +++++++++++++++++ .../expectedOutput-2.3/bundle.transpiled.js | 78 +++++++++++++++++ .../expectedOutput-2.3/output.txt | 4 + .../expectedOutput-2.3/patch0/bundle.js | 78 +++++++++++++++++ .../patch0/bundle.transpiled.js | 78 +++++++++++++++++ .../expectedOutput-2.3/patch0/output.txt | 4 + .../expectedOutput-2.3/patch1/bundle.js | 78 +++++++++++++++++ .../patch1/bundle.transpiled.js | 78 +++++++++++++++++ .../expectedOutput-2.3/patch1/output.txt | 4 + .../expectedOutput-2.4/bundle.js | 78 +++++++++++++++++ .../expectedOutput-2.4/output.txt | 4 + .../expectedOutput-2.4/patch0/bundle.js | 78 +++++++++++++++++ .../expectedOutput-2.4/patch0/output.txt | 4 + .../expectedOutput-2.4/patch1/bundle.js | 78 +++++++++++++++++ .../expectedOutput-2.4/patch1/output.txt | 4 + .../expectedOutput-2.5/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.5/output.txt | 3 + .../expectedOutput-2.5/patch0/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.5/patch0/output.txt | 3 + .../expectedOutput-2.5/patch1/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.5/patch1/output.txt | 3 + .../expectedOutput-2.6/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.6/output.txt | 3 + .../expectedOutput-2.6/patch0/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.6/patch0/output.txt | 3 + .../expectedOutput-2.6/patch1/bundle.js | 75 ++++++++++++++++ .../expectedOutput-2.6/patch1/output.txt | 3 + .../expectedOutput-2.7/bundle.js | 85 +++++++++++++++++++ .../expectedOutput-2.7/output.transpiled.txt | 5 ++ .../expectedOutput-2.7/output.txt | 5 ++ .../expectedOutput-2.7/patch0/bundle.js | 85 +++++++++++++++++++ .../patch0/output.transpiled.txt | 5 ++ .../expectedOutput-2.7/patch0/output.txt | 5 ++ .../expectedOutput-2.7/patch1/bundle.js | 85 +++++++++++++++++++ .../patch1/output.transpiled.txt | 5 ++ .../expectedOutput-2.7/patch1/output.txt | 5 ++ .../patch0/app.ts | 2 + .../patch1/app.ts | 2 + .../tsconfig.json | 5 ++ .../uppercaseStringLiteralTransformer.js | 16 ++++ .../webpack.config.js | 23 +++++ 46 files changed, 1564 insertions(+), 3 deletions(-) create mode 100644 test/comparison-tests/customTransformerUsingPathString/app.ts create mode 100644 test/comparison-tests/customTransformerUsingPathString/customerTransformers.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.transpiled.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.transpiled.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.transpiled.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.transpiled.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.transpiled.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/bundle.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.transpiled.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.txt create mode 100644 test/comparison-tests/customTransformerUsingPathString/patch0/app.ts create mode 100644 test/comparison-tests/customTransformerUsingPathString/patch1/app.ts create mode 100644 test/comparison-tests/customTransformerUsingPathString/tsconfig.json create mode 100644 test/comparison-tests/customTransformerUsingPathString/uppercaseStringLiteralTransformer.js create mode 100644 test/comparison-tests/customTransformerUsingPathString/webpack.config.js diff --git a/README.md b/README.md index 13605933e..087c95d52 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ This will ensure that the plugin checks for both syntactic errors (eg `const arr #### getCustomTransformers _( () => { before?: TransformerFactory[]; after?: TransformerFactory[]; } )_ Provide custom transformers - only compatible with TypeScript 2.3+ (and 2.4 if using `transpileOnly` mode). For example usage take a look at [typescript-plugin-styled-components](https://github.com/Igorbek/typescript-plugin-styled-components) or our [test](test/comparison-tests/customTransformer). +You can also pass a path string to locate a js module file which export the function described above, especially in `happyPackMode`. (Because forked proccess cannot serialize functions see more at [related issue](https://github.com/Igorbek/typescript-plugin-styled-components/issues/6#issue-303387183)) #### logInfoToStdOut _(boolean) (default=false)_ diff --git a/src/instances.ts b/src/instances.ts index 8aa1d0b4a..88a6d9585 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -137,8 +137,32 @@ function successfulTypeScriptInstance( const files: TSFiles = new Map(); const otherFiles: TSFiles = new Map(); - const getCustomTransformers = - loaderOptions.getCustomTransformers || Function.prototype; + // same strategy as https://github.com/s-panferov/awesome-typescript-loader/pull/531/files + let { getCustomTransformers: customerTransformers } = loaderOptions; + let getCustomTransformers = Function.prototype; + + if (typeof customerTransformers === 'function') { + getCustomTransformers = customerTransformers; + } else if (typeof customerTransformers === 'string') { + try { + customerTransformers = require(customerTransformers); + } catch (err) { + throw new Error( + `Failed to load customTransformers from "${ + loaderOptions.getCustomTransformers + }": ${err.message}` + ); + } + + if (typeof customerTransformers !== 'function') { + throw new Error( + `Custom transformers in "${ + loaderOptions.getCustomTransformers + }" should export a function, got ${typeof getCustomTransformers}` + ); + } + getCustomTransformers = customerTransformers; + } if (loaderOptions.transpileOnly) { // quick return for transpiling diff --git a/src/interfaces.ts b/src/interfaces.ts index c98e02345..079491c3d 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -300,7 +300,9 @@ export interface LoaderOptions { appendTsSuffixTo: RegExp[]; appendTsxSuffixTo: RegExp[]; happyPackMode: boolean; - getCustomTransformers?(): typescript.CustomTransformers | undefined; + getCustomTransformers?: + | string + | (() => typescript.CustomTransformers | undefined); experimentalWatchApi: boolean; } diff --git a/test/comparison-tests/customTransformerUsingPathString/app.ts b/test/comparison-tests/customTransformerUsingPathString/app.ts new file mode 100644 index 000000000..ce0094812 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/app.ts @@ -0,0 +1,2 @@ +var message = "Hello from me!"; +console.log(message); diff --git a/test/comparison-tests/customTransformerUsingPathString/customerTransformers.js b/test/comparison-tests/customTransformerUsingPathString/customerTransformers.js new file mode 100644 index 000000000..977213398 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/customerTransformers.js @@ -0,0 +1,5 @@ +var uppercaseStringLiteralTransformer = require('./uppercaseStringLiteralTransformer').default; + +module.exports = () => ({ + before: [uppercaseStringLiteralTransformer] +}); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.js new file mode 100644 index 000000000..6f4850711 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM ME!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.transpiled.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.transpiled.js new file mode 100644 index 000000000..ea93c308c --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/bundle.transpiled.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "Hello from me!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/output.txt new file mode 100644 index 000000000..7196dfcf8 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 54 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.js new file mode 100644 index 000000000..553a36e58 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM HIM!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.transpiled.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.transpiled.js new file mode 100644 index 000000000..18f1a663e --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/bundle.transpiled.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "Hello from him!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/output.txt new file mode 100644 index 000000000..c17569629 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch0/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 55 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 55 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.js new file mode 100644 index 000000000..de6e20451 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM US!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.transpiled.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.transpiled.js new file mode 100644 index 000000000..5c4afd468 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/bundle.transpiled.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "Hello from us!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/output.txt new file mode 100644 index 000000000..7196dfcf8 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.3/patch1/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 54 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/bundle.js new file mode 100644 index 000000000..6f4850711 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM ME!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/output.txt new file mode 100644 index 000000000..7196dfcf8 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 54 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/bundle.js new file mode 100644 index 000000000..553a36e58 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM HIM!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/output.txt new file mode 100644 index 000000000..c17569629 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch0/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 55 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 55 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/bundle.js new file mode 100644 index 000000000..de6e20451 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/bundle.js @@ -0,0 +1,78 @@ +/******/ (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; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // 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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM US!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/output.txt new file mode 100644 index 000000000..7196dfcf8 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.4/patch1/output.txt @@ -0,0 +1,4 @@ + Asset Size Chunks Chunk Names +bundle.js 2.69 kB 0 [emitted] main +chunk {0} bundle.js (main) 54 bytes [entry] [rendered] + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/bundle.js new file mode 100644 index 000000000..5de973a26 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM ME!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/output.txt new file mode 100644 index 000000000..f2ad31a14 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/bundle.js new file mode 100644 index 000000000..8fe524a37 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM HIM!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/output.txt new file mode 100644 index 000000000..10fc70d49 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch0/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 55 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/bundle.js new file mode 100644 index 000000000..cca1c43c7 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM US!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/output.txt new file mode 100644 index 000000000..f2ad31a14 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.5/patch1/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/bundle.js new file mode 100644 index 000000000..5de973a26 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM ME!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/output.txt new file mode 100644 index 000000000..f2ad31a14 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/bundle.js new file mode 100644 index 000000000..8fe524a37 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM HIM!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/output.txt new file mode 100644 index 000000000..10fc70d49 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch0/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 55 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/bundle.js new file mode 100644 index 000000000..cca1c43c7 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/bundle.js @@ -0,0 +1,75 @@ +/******/ (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 +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // 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) { + +var message = "HELLO FROM US!"; +console.log(message); + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/output.txt new file mode 100644 index 000000000..f2ad31a14 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.6/patch1/output.txt @@ -0,0 +1,3 @@ + Asset Size Chunks Chunk Names +bundle.js 2.53 kB 0 [emitted] main + [0] ./.test/customTransformer/app.ts 54 bytes {0} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/bundle.js new file mode 100644 index 000000000..9c57c4a51 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/bundle.js @@ -0,0 +1,85 @@ +/******/ (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 = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var message = \"HELLO FROM ME!\";\nconsole.log(message);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.transpiled.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.transpiled.txt new file mode 100644 index 000000000..aecaa6aac --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.transpiled.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:51:55 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 54 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.txt new file mode 100644 index 000000000..f2842b613 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/output.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:51:49 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 54 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/bundle.js new file mode 100644 index 000000000..f028a65aa --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/bundle.js @@ -0,0 +1,85 @@ +/******/ (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 = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var message = \"HELLO FROM HIM!\";\nconsole.log(message);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.transpiled.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.transpiled.txt new file mode 100644 index 000000000..8c8b5ea55 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.transpiled.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:51:58 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 55 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.txt new file mode 100644 index 000000000..d185dbae2 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch0/output.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:51:52 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 55 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/bundle.js b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/bundle.js new file mode 100644 index 000000000..530f6981f --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/bundle.js @@ -0,0 +1,85 @@ +/******/ (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 = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var message = \"HELLO FROM US!\";\nconsole.log(message);\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.transpiled.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.transpiled.txt new file mode 100644 index 000000000..d28730a2a --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.transpiled.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:52:00 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 54 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.txt b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.txt new file mode 100644 index 000000000..71015539d --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/expectedOutput-2.7/patch1/output.txt @@ -0,0 +1,5 @@ +Built at: 2018-2-11 17:51:54 + Asset Size Chunks Chunk Names +bundle.js 2.83 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 54 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/patch0/app.ts b/test/comparison-tests/customTransformerUsingPathString/patch0/app.ts new file mode 100644 index 000000000..a16033db1 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/patch0/app.ts @@ -0,0 +1,2 @@ +var message = "Hello from him!"; +console.log(message); diff --git a/test/comparison-tests/customTransformerUsingPathString/patch1/app.ts b/test/comparison-tests/customTransformerUsingPathString/patch1/app.ts new file mode 100644 index 000000000..37e82e809 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/patch1/app.ts @@ -0,0 +1,2 @@ +var message = "Hello from us!"; +console.log(message); diff --git a/test/comparison-tests/customTransformerUsingPathString/tsconfig.json b/test/comparison-tests/customTransformerUsingPathString/tsconfig.json new file mode 100644 index 000000000..94d996e96 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + + } +} \ No newline at end of file diff --git a/test/comparison-tests/customTransformerUsingPathString/uppercaseStringLiteralTransformer.js b/test/comparison-tests/customTransformerUsingPathString/uppercaseStringLiteralTransformer.js new file mode 100644 index 000000000..3c72c182c --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/uppercaseStringLiteralTransformer.js @@ -0,0 +1,16 @@ +"use strict"; +exports.__esModule = true; +var ts = require("typescript"); +var transformer = function (context) { + var visitor = function (node) { + if (node.kind === ts.SyntaxKind.StringLiteral) { + var text = node.text; + if (text !== text.toUpperCase()) { + return ts.createLiteral(text.toUpperCase()); + } + } + return ts.visitEachChild(node, visitor, context); + }; + return function (node) { return ts.visitNode(node, visitor); }; +}; +exports["default"] = transformer; diff --git a/test/comparison-tests/customTransformerUsingPathString/webpack.config.js b/test/comparison-tests/customTransformerUsingPathString/webpack.config.js new file mode 100644 index 000000000..768209856 --- /dev/null +++ b/test/comparison-tests/customTransformerUsingPathString/webpack.config.js @@ -0,0 +1,23 @@ +var path = require('path') + +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { + test: /\.ts$/, + loader: 'ts-loader', + options: { + getCustomTransformers: path.resolve(__dirname, './customerTransformers.js') + } + } + ] + } +}