From 9315e3708c62c24625743c4b0e1dad4d0642bcf0 Mon Sep 17 00:00:00 2001 From: hanlee Date: Tue, 2 Mar 2021 17:31:52 +0900 Subject: [PATCH] Revert "feat: replace square brackets in bundle file name, close #16" This reverts commit a55e9e546931783bec117999d57fc63e70e66523. --- .eslintrc.json | 3 +-- src/index.ts | 10 ---------- src/types.ts | 5 ----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index af1f4271..b7af0aa8 100644 --- a/.eslintrc.json +++ b/.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"] } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 8bf000bb..885d94d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,6 @@ function resolveOptions(userOptions: UserOptions): ResolvedOptions { routeBlockLang = 'json5', exclude = [], syncIndex = true, - replaceSquareBrackets = true, } = userOptions const root = process.cwd() @@ -46,7 +45,6 @@ function resolveOptions(userOptions: UserOptions): ResolvedOptions { importMode, exclude, syncIndex, - replaceSquareBrackets, }, userOptions, ) @@ -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}/`)) diff --git a/src/types.ts b/src/types.ts index 57e0b3a5..1b80dcea 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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 */