1.0.0 • Published 2 years ago
webpack-fs-routes-plugin v1.0.0
webpack-fs-routes-plugin
Next.js style file system routes https://nextjs.org/docs/routing/introduction.
Install
npm i webpack-fs-routes-plugin
Usage
import WebpackFsRoutesPlugin from 'webpack-fs-routes-plugin'
export interface UserOptions {
/**
* The path to the directory containing your page routes
* @default <rootDir>/src/pages
*/
routesDir?: string
/**
* Supported file extensions for page routes
* @default ['.tsx']
*/
routeExtensions?: string[]
/**
* Development build
* @default false
*/
isDev?: boolean
/**
* @default false
*/
caseSensitive?: boolean
/**
* @default 5
*/
reactRouterVersion?: 5 | 6
}
const options: UserOptions = {}
export default {
// ...
plugins: [
WebpackFsRoutesPlugin(options),
],
}
Or checkout config-overrides.js
in examples/.
Sponsors
License
MIT © lxy-yz
1.0.0
2 years ago