parcel-resolver-modernizr
v0.0.4
Published
Parcel 2.0 resolver for modernizr
Downloads
25
Maintainers
Readme
parcel-resolver-modernizr
A Parcel resolver for custom Modernizr builds, migrate/inspired in parcel-plugin-modernizr
Installation
Using NPM
$ npm install parcel-resolver-modernizr -D
This plugins needs Modernizr to be installed in your project devDependencies
Setup
Create a file
modernizr-config.json
(you can also use.modernizrrc
) in your project root folder with your desired Modernizr configuration. You can also use Modernizr to generate a custom configuration for your project.Include "parcel-resolver-modernizr" in your .parcelrc config file, remember to add all the resolvers previously configured
{
"extends": "@parcel/config-default",
"resolvers": ["parcel-resolver-modernizr", "..."]
}
Usage: Embedded in html
This option is similar to parcel-plugin-modernizr usage option 1. Where you include the "modernizr.js" js module in your index.html file
./src/index.html:
<script type="module" src="modernizr.js"></script>
./src/modernizr-config.json: Your modernizr config
$ parcel ./src/index.html
Output
./dist/index.html:
<script src="modernizr.contentHash.js"></script>
./dist/index.contentHash.js: Your custom modernizr build
Limitations
- package.json option is currently unavailiable
- resource name 'modernizr.js' is not configurable
Contributing
Pull requests are welcome!