-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add genetate-history-method bin and support .generate-history-m…
…ethod.config.js
- Loading branch information
Showing
15 changed files
with
118 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
{ | ||
"name": "genetate-history-method-webpack-plugin", | ||
"name": "generate-history-method-webpack-plugin", | ||
"version": "1.2.1", | ||
"packageManager": "[email protected]", | ||
"description": "A webpack Plugin for automatically generating routing methods based on conventional routing", | ||
"author": "baozouai <[email protected]>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/baozouai/genetate-history-method-webpack-plugin", | ||
"homepage": "https://github.com/baozouai/generate-history-method-webpack-plugin", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/baozouai/genetate-history-method-webpack-plugin.git" | ||
"url": "https://github.com/baozouai/generate-history-method-webpack-plugin.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/baozouai/genetate-history-method-webpack-plugin/issues" | ||
"url": "https://github.com/baozouai/generate-history-method-webpack-plugin/issues" | ||
}, | ||
"bin": { | ||
"generate-history-method": "dist/generate-history-method.cjs" | ||
}, | ||
"keywords": [ | ||
"webpack", | ||
|
@@ -20,9 +23,9 @@ | |
"webpack-plugin", | ||
"add react history method" | ||
], | ||
"main": "dist/genetate-history-method-webpack-plugin.cjs", | ||
"types": "dist/genetate-history-method-webpack-plugin.d.ts", | ||
"module": "./dist/genetate-history-method-webpack-plugin.mjs", | ||
"main": "dist/generate-history-method-webpack-plugin.cjs", | ||
"types": "dist/generate-history-method-webpack-plugin.d.ts", | ||
"module": "./dist/generate-history-method-webpack-plugin.mjs", | ||
"files": [ | ||
"dist" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
playgrounds/react-router-5/.generate-history-method.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const path = require('path') | ||
|
||
const isHash = process.env.HISTORY_MODE === 'hash' | ||
module.exports = { | ||
pagesRootPath: path.resolve(__dirname, 'src/pages'), | ||
originHistoryModuleName: isHash ? '@/hash_history' : '@/browser_history', | ||
mode: process.env.HISTORY_MODE, | ||
reactRouterVersion: 5, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,5 @@ | |
}, | ||
|
||
}, | ||
"include": ["src", "./webpack.config.js"] | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
import GenerateHistoryMethodWebpackPlugin from '../generate-history-method-webpack-plugin' | ||
new GenerateHistoryMethodWebpackPlugin().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { resolve } from 'path' | ||
export const CONFIG_FILE_PATH = resolve(process.cwd(), '.generate-history-method.config.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters