Import `.html` files as strings in your Next.js project
npm install @blunck/next-htmlImport .html files as strings in your Next.js project
```
npm install --save @blunck/next-html
Create a next.config.js in your project
`js`
// next.config.js
const withHtml = require('@blunck/next-html')()
module.exports = withHtml()
You can now import .html files as strings
`js
import foo from './foo.html'
export default () =>
$3
Optionally you can provide html-loader options
`js
// next.config.js
const withHtml = require('@blunck/next-html')({
minimize: true,
conservativeCollapse: false
})
module.exports = withHtml()
`$3
Optionally you can add your custom Next.js configuration as parameter
`js
// next.config.js
const withHtml = require('@blunck/next-html')()
module.exports = withHtml({
webpack(config, options) {
return config
}
})
``