file-loader example
Next.jsI couldn't get the with-hashed-statics example working, so I made my own. This example:
- Lets you
import image from "./some/image.jpg"
in .js files. - Lets you
url("./some/image.jpg")
in .css files. - Works during development (
next
). - Works with
next start
(afternext build
). - Works with
next export
.
Try it out:
- Clone this repo.
- Install dependencies:
npm ci
- Run in dev mode:
npm run dev
- Build and export:
npm run build
- Run in production mode:
npm start
- Serve static export:
npm run serve