ember-vite-hmr 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/hmr.js +4 -1
- package/package.json +1 -1
package/dist/lib/hmr.js
CHANGED
|
@@ -119,7 +119,7 @@ function hmr(enableViteHmrForModes = ['development']) {
|
|
|
119
119
|
.toString();
|
|
120
120
|
},
|
|
121
121
|
resolveId(id, importer) {
|
|
122
|
-
if (importer.startsWith(virtualPrefix)) {
|
|
122
|
+
if (importer === null || importer === void 0 ? void 0 : importer.startsWith(virtualPrefix)) {
|
|
123
123
|
importer = path_1.default.join(process.cwd(), 'package.json');
|
|
124
124
|
return this.resolve(id, importer);
|
|
125
125
|
}
|
|
@@ -200,6 +200,9 @@ function hmr(enableViteHmrForModes = ['development']) {
|
|
|
200
200
|
},
|
|
201
201
|
transform(source, id) {
|
|
202
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
|
|
204
|
+
return source;
|
|
205
|
+
}
|
|
203
206
|
const resourcePath = id.replace(/\\/g, '/').split('?')[0];
|
|
204
207
|
let didReplaceSources = false;
|
|
205
208
|
const name = require(`${process.cwd()}/package.json`).name;
|