diff --git a/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/browser--test_gpFj.js b/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/browser--test_gpFj.js index e81ea79..4cc8ce0 100644 --- a/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/browser--test_gpFj.js +++ b/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/browser--test_gpFj.js @@ -19,10 +19,7 @@ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/test.marko?dependencies"); const { init } = __webpack_require__(/*! marko/components */ "marko/components"); diff --git a/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/server--main.js b/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/server--main.js index 2704a31..a3e0afc 100644 --- a/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/server--main.js +++ b/src/__tests__/fixtures/basic-template-plugin-custom-runtime-id/__snapshots__/server--main.js @@ -96,7 +96,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; diff --git a/src/__tests__/fixtures/basic-template-plugin/__snapshots__/browser--test_uYWJ.js b/src/__tests__/fixtures/basic-template-plugin/__snapshots__/browser--test_uYWJ.js index 1dabe28..527aaf4 100644 --- a/src/__tests__/fixtures/basic-template-plugin/__snapshots__/browser--test_uYWJ.js +++ b/src/__tests__/fixtures/basic-template-plugin/__snapshots__/browser--test_uYWJ.js @@ -19,10 +19,7 @@ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/basic-template-plugin/test.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/basic-template-plugin/__snapshots__/server--main.js b/src/__tests__/fixtures/basic-template-plugin/__snapshots__/server--main.js index e11c0f0..abe32a4 100644 --- a/src/__tests__/fixtures/basic-template-plugin/__snapshots__/server--main.js +++ b/src/__tests__/fixtures/basic-template-plugin/__snapshots__/server--main.js @@ -96,7 +96,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; diff --git a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--bar_aSxt.js b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--bar_aSxt.js index 41ce402..64bedbe 100644 --- a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--bar_aSxt.js +++ b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--bar_aSxt.js @@ -19,10 +19,7 @@ __webpack_require__(/*! ./components/shared.marko?dependencies */ "./src/__tests /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./bar.marko?dependencies */ "./src/__tests__/fixtures/multiple-entries-plugin/bar.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--foo_3XPO.js b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--foo_3XPO.js index 7d3fca6..1c70011 100644 --- a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--foo_3XPO.js +++ b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/browser--foo_3XPO.js @@ -19,10 +19,7 @@ __webpack_require__(/*! ./components/shared.marko?dependencies */ "./src/__tests /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./foo.marko?dependencies */ "./src/__tests__/fixtures/multiple-entries-plugin/foo.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/server--main.js b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/server--main.js index ae3275e..7292306 100644 --- a/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/server--main.js +++ b/src/__tests__/fixtures/multiple-entries-plugin/__snapshots__/server--main.js @@ -85,7 +85,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; @@ -257,7 +257,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; diff --git a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-A--test_YDNP.A.js b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-A--test_YDNP.A.js index 6fb8333..00fd4dc 100644 --- a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-A--test_YDNP.A.js +++ b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-A--test_YDNP.A.js @@ -103,10 +103,7 @@ __webpack_require__(/*! ./components/nested/index.marko?dependencies */ "./src/_ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/test.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-B--test_YDNP.B.js b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-B--test_YDNP.B.js index 094e51f..04dc1b9 100644 --- a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-B--test_YDNP.B.js +++ b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-B--test_YDNP.B.js @@ -103,10 +103,7 @@ __webpack_require__(/*! ./components/nested/index.marko?dependencies */ "./src/_ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/test.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-C--test_YDNP.C.js b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-C--test_YDNP.C.js index 026333b..3df862c 100644 --- a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-C--test_YDNP.C.js +++ b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/browser-C--test_YDNP.C.js @@ -103,10 +103,7 @@ __webpack_require__(/*! ./components/nested/index.marko?dependencies */ "./src/_ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/test.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/server--main.js b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/server--main.js index 44c0f90..d657929 100644 --- a/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/server--main.js +++ b/src/__tests__/fixtures/with-class-component-plugin-dynamic-bundle/__snapshots__/server--main.js @@ -158,7 +158,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; diff --git a/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/browser--test_nzzJ.js b/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/browser--test_nzzJ.js index 4ffa4fb..70dd3ec 100644 --- a/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/browser--test_nzzJ.js +++ b/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/browser--test_nzzJ.js @@ -101,10 +101,7 @@ __webpack_require__(/*! ./components/nested/index.marko?dependencies */ "./src/_ /***/ (function(module, exports, __webpack_require__) { - if (window.$mwp) { - __webpack_require__.p = $mwp; - } - + if (window.$mwp) __webpack_require__.p = $mwp; __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/with-class-component-plugin/test.marko?dependencies"); window.$initComponents && $initComponents(); diff --git a/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/server--main.js b/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/server--main.js index 14c3d1d..3fc613d 100644 --- a/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/server--main.js +++ b/src/__tests__/fixtures/with-class-component-plugin/__snapshots__/server--main.js @@ -151,7 +151,7 @@ function renderAssets() { this.end = this.___end; if (assets) { - this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); + __webpack_require__.p && this.script(`$mwp=${JSON.stringify(__webpack_require__.p)}`); if (assets.js) { const setNonce = nonce && `.setAttribute("nonce", ${JSON.stringify(nonce)})`; diff --git a/src/__tests__/fixtures/with-public-path/__snapshots__/browser--test_CDVG.js b/src/__tests__/fixtures/with-public-path/__snapshots__/browser--test_CDVG.js new file mode 100644 index 0000000..617418c --- /dev/null +++ b/src/__tests__/fixtures/with-public-path/__snapshots__/browser--test_CDVG.js @@ -0,0 +1,30 @@ +/******/ ({ + +/***/ "./src/__tests__/fixtures/with-public-path/test.marko?dependencies": +/*!*************************************************************************!*\ + !*** ./src/__tests__/fixtures/with-public-path/test.marko?dependencies ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + + + +/***/ }), + +/***/ "./src/__tests__/fixtures/with-public-path/test.marko?hydrate": +/*!********************************************************************!*\ + !*** ./src/__tests__/fixtures/with-public-path/test.marko?hydrate ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + + __webpack_require__(/*! ./test.marko?dependencies */ "./src/__tests__/fixtures/with-public-path/test.marko?dependencies"); + window.$initComponents && $initComponents(); + + + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/src/__tests__/fixtures/with-public-path/__snapshots__/server--main.js b/src/__tests__/fixtures/with-public-path/__snapshots__/server--main.js new file mode 100644 index 0000000..f3143ca --- /dev/null +++ b/src/__tests__/fixtures/with-public-path/__snapshots__/server--main.js @@ -0,0 +1,235 @@ +/******/ ({ + +/***/ "./__MARKO_WEBPACK__MANIFEST.js": +/*!**************************************!*\ + !*** ./__MARKO_WEBPACK__MANIFEST.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + getAssets(entry) { + return this.build[entry]; + }, + build: {"test_CDVG":{"js":["test_CDVG.js"]}} +} + +/***/ }), + +/***/ "./src/__tests__/fixtures/with-public-path/server.js": +/*!***********************************************************!*\ + !*** ./src/__tests__/fixtures/with-public-path/server.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +const http = __webpack_require__(/*! http */ "http"); +const test = __webpack_require__(/*! ./test.marko */ "./src/__tests__/fixtures/with-public-path/test.marko?assets"); + +http + .createServer((req, res) => { + test.render({}, res); + }) + .listen(0); + + +/***/ }), + +/***/ "./src/__tests__/fixtures/with-public-path/test.marko": +/*!************************************************************!*\ + !*** ./src/__tests__/fixtures/with-public-path/test.marko ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(__filename) { + +var marko_template = module.exports = __webpack_require__(/*! marko/dist/html */ "marko/dist/html").t(__filename), + marko_componentType = "/@marko/webpack-tests$x.x.x/fixtures/with-public-path/test.marko", + marko_renderer = __webpack_require__(/*! marko/dist/runtime/components/renderer */ "marko/dist/runtime/components/renderer"); + +function render(input, out, __component, component, state) { + var data = input; + + out.w("