Skip to content

Commit

Permalink
Revert "feat: replace square brackets in bundle file name, close #16"
Browse files Browse the repository at this point in the history
This reverts commit a55e9e5.
  • Loading branch information
hannoeru committed Mar 2, 2021
1 parent 4fdebf5 commit 9f924d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
@@ -1,8 +1,7 @@
{
"extends": "@antfu/eslint-config",
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"no-restricted-syntax": "off"
"@typescript-eslint/no-unused-vars": "off"
},
"ignorePatterns": ["dist"]
}
10 changes: 0 additions & 10 deletions src/index.ts
Expand Up @@ -16,7 +16,6 @@ function resolveOptions(userOptions: UserOptions): ResolvedOptions {
routeBlockLang = 'json5',
exclude = [],
syncIndex = true,
replaceSquareBrackets = true,
} = userOptions

const root = process.cwd()
Expand Down Expand Up @@ -46,7 +45,6 @@ function resolveOptions(userOptions: UserOptions): ResolvedOptions {
importMode,
exclude,
syncIndex,
replaceSquareBrackets,
},
userOptions,
)
Expand Down Expand Up @@ -117,14 +115,6 @@ function routePlugin(userOptions: UserOptions = {}): Plugin {
map: null,
}
},
generateBundle(_options, bundle) {
if (options.replaceSquareBrackets) {
for (const name in bundle) {
const chunk = bundle[name]
chunk.fileName = chunk.fileName.replace(/(\[|\])/g, '_')
}
}
},
async handleHotUpdate({ file, server, read }) {
const extensionsRE = new RegExp(`\\.(${options.extensions.join('|')})$`)
const matchedPath = (pagesDirPaths).find(p => file.startsWith(`${p}/`))
Expand Down
5 changes: 0 additions & 5 deletions src/types.ts
Expand Up @@ -56,11 +56,6 @@ interface Options {
* @default 'json5'
*/
routeBlockLang: 'json5' | 'json' | 'yaml'
/**
* Replace '[]' to '_' in bundle chunk filename
* @default true
*/
replaceSquareBrackets: boolean
/**
* Extend route records
*/
Expand Down

0 comments on commit 9f924d9

Please sign in to comment.