Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Commit 6ea6f63

Browse files
author
Eimantas
authored
Updated path. (#21)
* Updated path. * Applying package updates.
1 parent 3339119 commit 6ea6f63

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

packages/webpack-builder-plugin-image-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reactway/image-loader",
3-
"version": "1.0.0-alpha.19",
3+
"version": "1.0.0-alpha.20",
44
"description": "A plugin made for webpack to load images, optimize and resize.",
55
"keywords": [
66
"webpack",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare var __webpack_public_path__: string;

packages/webpack-builder-plugin-image-loader/src/__tests__/__snapshots__/plugin.test.ts.snap

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/webpack-builder-plugin-image-loader/src/__tests__/plugin.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import webpack from "webpack";
22
import webpackCompiler from "./compiler/compiler";
33
import { ReactwayImageLoaderPlugin } from "../plugin";
44

5+
// tslint:disable-next-line:no-any
6+
(global as any).__webpack_public_path__ = "";
7+
58
describe("ReactwayImagePlugin displaying stats", () => {
69
it("Adding plugin to config", async () => {
710
const loader: webpack.RuleSetRule[] = [

packages/webpack-builder-plugin-image-loader/src/image-loader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ class ImageLoader {
198198
context: this.rootContext,
199199
content: contentBuffer
200200
});
201-
const path = `__webpack_public_path__ + ${JSON.stringify(url)}`;
201+
202+
const path = `${__webpack_public_path__} + ${JSON.stringify(url)}`;
202203

203204
// If 'optimizeImagesInDev' value set to 'true' then every build check if files(images) exists in output dir is skipped.
204205
if (!options.optimizeImagesInDev) {

0 commit comments

Comments
 (0)