0.1.2 • Published 2 years ago
@astropub/assert v0.1.2
Astro Import Assertions
npm install @astropub/assert
// astro.config.js
import { assertPlugin } from '@astropub/assert'
export default {
vite: {
plugins: [
assertPlugin()
]
}
}
Configuration
You can pass in special handlers for load
and transform
when imports with assertions are encountered.
import { assertions } from '@astropub/assert'
// astro.config.js
export default {
vite: {
plugins: [
load(id, assert) {
console.log(assert)
// e.g. { type: "json" }
// e.g. { type: "react-component", client: "load" }
}
]
}
}
`load(id, assertions, )
License
Codecs is a remix of Squoosh!.
Code original to this project is licensed under the CC0-1.0 License.
Code from Squoosh! is licensed under the Apache-2.0 License, Copyright Google Inc.