Skip to content
This repository was archived by the owner on Jul 11, 2024. It is now read-only.

Commit 53d0782

Browse files
authored
Fix Picture tag outputting a comment and export image directly instead of as default when loading. (#526)
1 parent 4b327d5 commit 53d0782

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

common/web/base-web/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
extends: '@curiostack/web',
3+
rules: {
4+
'react/destructuring-assignment': 'off',
5+
},
6+
parserOptions: {
7+
tsconfigRootDir: __dirname,
8+
}
9+
};

common/web/base-web/.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

common/web/base-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@curiostack/base-web",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Curiostack's base dependencies for browser applications.",
55
"repository": "curioswitch/curiostack",
66
"author": "Choko <choko@curioswitch.org>",

common/web/base-web/src/components/Picture/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export default class Picture extends React.PureComponent<Props> {
4848
// eslint-disable-next-line react/jsx-props-no-spreading
4949
<source key={source.type} {...source} />
5050
))}
51-
// eslint-disable-next-line jsx-a11y/alt-text
5251
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
5352
<img src={image.fallback} alt={alt} {...others} />
5453
</picture>

common/web/base-web/src/dev/webpack/curio-image-loader/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async function run(ctx: LoaderContext, content: Buffer) {
176176
fallback,
177177
};
178178

179-
ctx.callback(undefined, `export default ${JSON.stringify(output)}`);
179+
ctx.callback(undefined, `module.exports = ${JSON.stringify(output)}`);
180180
}
181181

182182
export default function curioImageLoader(this: LoaderContext, content: Buffer) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@babel/runtime-corejs2": "7.8.7",
1717
"@babel/runtime-corejs3": "7.8.7",
1818
"@curiostack/base-node-dev": "0.2.0",
19-
"@curiostack/base-web": "0.2.1",
19+
"@curiostack/base-web": "0.2.2",
2020
"@curiostack/eslint-config-base": "0.2.0",
2121
"@curiostack/eslint-config-web": "0.2.0",
2222
"@curiostack/tsconfig": "0.1.0",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@
906906
typescript "3.8.3"
907907

908908
"@curiostack/base-web@0.2.0":
909-
version "0.2.1"
909+
version "0.2.2"
910910
dependencies:
911911
"@babel/core" "7.8.7"
912912
"@babel/plugin-proposal-async-generator-functions" "7.8.3"

0 commit comments

Comments
 (0)