-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ddenysiuk
committed
Feb 20, 2024
1 parent
38e872a
commit 38ed378
Showing
13 changed files
with
1,692 additions
and
41 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# @assetpack/plugin-compressed-textures | ||
|
||
AssetPack plugin for generation compressed textures. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install --save-dev @assetpack/plugin-compressed-textures | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
import { generateAstc, generateBc, generateEtc } from '@assetpack/compressed-textures'; | ||
|
||
export default { | ||
... | ||
plugins: { | ||
... | ||
generateAstc: generateAstc(), | ||
generateBc: generateBc(), | ||
generateEtc: generateEtc(), | ||
}, | ||
}; | ||
``` | ||
|
||
## Options | ||
|
||
### generateAstc | ||
|
||
- compression: Any settings supported by [@gpu-tex-enc/astc](https://www.npmjs.com/package/@gpu-tex-enc/astc) | ||
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`. | ||
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file. | ||
|
||
### generateBc | ||
|
||
- compression: Any settings supported by [@gpu-tex-enc/bc](https://www.npmjs.com/package/@gpu-tex-enc/bc) | ||
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`. | ||
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file. | ||
|
||
### generateEtc | ||
|
||
- compression: Any settings supported by [@gpu-tex-enc/etc](https://www.npmjs.com/package/@gpu-tex-enc/etc) | ||
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`. | ||
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const sharedConfig = require('../../jest.config'); | ||
|
||
module.exports = { | ||
...sharedConfig, | ||
rootDir: './', | ||
moduleNameMapper: { | ||
'^@assetpack/plugin-(.*)$': '<rootDir>/../$1/src', | ||
'^@assetpack/(.*)$': '<rootDir>/../$1/src', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@assetpack/plugin-compressed-textures", | ||
"version": "0.8.0", | ||
"description": "", | ||
"homepage": "https://github.com/pixijs/assetpack/tree/master/packages/compressed-textures/#readme", | ||
"bugs": "https://github.com/pixijs/assetpack/issues", | ||
"repository": { | ||
"url": "pixijs/assetpack", | ||
"directory": "packages/compressed-textures" | ||
}, | ||
"license": "MIT", | ||
"author": "ddenysiuk", | ||
"exports": { | ||
"import": "./dist/es/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"default": "./dist/cjs/index.js" | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/es/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"*.d.ts" | ||
], | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "rollup -c", | ||
"test": "npx jest --config ./jest.config.js", | ||
"test:types": "tsc --noEmit" | ||
}, | ||
"dependencies": { | ||
"fs-extra": "^11.1.0", | ||
"gpu-tex-enc": "^1.1.3" | ||
}, | ||
"devDependencies": { | ||
"@assetpack/core": "0.8.0" | ||
}, | ||
"peerDependencies": { | ||
"@assetpack/core": ">=0.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { createConfig } from '../../shared/rollup.config.mjs'; | ||
|
||
export default createConfig({ | ||
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) | ||
}); |
Oops, something went wrong.