Skip to content

Commit ac04774

Browse files
committed
Webpack 5
1 parent 71bb4e8 commit ac04774

File tree

10 files changed

+548
-1304
lines changed

10 files changed

+548
-1304
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"scripts": {
1010
"build": "tsc && cp ./src/cjs.js ./lib",
1111
"lint": "eslint",
12-
"test:clean": "find -E test/**/build/ -regex '.*/*.(avif|jpg|jpeg|webp|png|js)' -delete",
13-
"test": "npm run build && npm run test:clean && webpack --config=./test/jimp/webpack.config.js && webpack --config=./test/sharp/webpack.config.js && webpack --config=./test/cache/webpack.config.js && jest"
12+
"test:clean": "find -E test/**/build/ -regex '.*/*.(avif|jpe?g|webp|png|js)' -delete",
13+
"test": "npm run build && npm run test:clean && webpack --config=./test/jimp/webpack.config.js && webpack --config=./test/sharp/webpack.config.js && jest"
1414
},
1515
"files": [
1616
"lib",

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { validate } from 'schema-utils'
21
import * as schema from './schema.json'
2+
import { validate } from 'schema-utils'
3+
import { JSONSchema7 } from 'schema-utils/declarations/ValidationError'
4+
35
import { parseOptions, getOutputAndPublicPath, createPlaceholder } from './utils'
46
import { cache } from './cache'
57
import type { LoaderContext } from 'webpack'
@@ -16,7 +18,6 @@ import type {
1618
AdapterResizeResponse,
1719
TransformParams,
1820
} from './types'
19-
import { JSONSchema7 } from 'schema-utils/declarations/ValidationError'
2021

2122
const DEFAULTS = {
2223
quality: 85,

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type ParsedOptions = {
3333

3434
function parseOptions(loaderContext: LoaderContext<any>, options: Options): ParsedOptions {
3535
const outputContext: string = options.context || loaderContext.rootContext
36+
// <path>/<to>/<folder>/responsive-loader
37+
3638
const outputPlaceholder = Boolean(options.placeholder)
3739
const placeholderSize: number = parseInt(options.placeholderSize + '', 10)
3840

0 commit comments

Comments
 (0)