From 9ca91a2b1deda432f2db3eb51a7be90f1e918be8 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Wed, 11 Aug 2021 15:55:38 +0800 Subject: [PATCH] fix: fix entry path in js projects --- index.js | 5 +++++ playground/default/index.html | 2 +- playground/jsx-router-vuex-with-tests/index.html | 2 +- playground/jsx-router-vuex/index.html | 2 +- playground/jsx-router/index.html | 2 +- playground/jsx/index.html | 2 +- playground/router-vuex-with-tests/index.html | 2 +- playground/router-vuex/index.html | 2 +- playground/router/index.html | 2 +- playground/vuex-with-tests/index.html | 2 +- playground/vuex/index.html | 2 +- playground/with-tests/index.html | 2 +- template/base/index.html | 2 +- 13 files changed, 17 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index a5ea16fb..bf57c428 100755 --- a/index.js +++ b/index.js @@ -275,6 +275,11 @@ async function init() { } } ) + + // Rename entry in `index.html` + const indexHtmlPath = path.resolve(root, 'index.html') + const indexHtmlContent = fs.readFileSync(indexHtmlPath, 'utf8') + fs.writeFileSync(indexHtmlPath, indexHtmlContent.replace('src/main.js', 'src/main.ts')) } if (!needsTests) { diff --git a/playground/default/index.html b/playground/default/index.html index 11603f87..030a6ff5 100644 --- a/playground/default/index.html +++ b/playground/default/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/jsx-router-vuex-with-tests/index.html b/playground/jsx-router-vuex-with-tests/index.html index 11603f87..030a6ff5 100644 --- a/playground/jsx-router-vuex-with-tests/index.html +++ b/playground/jsx-router-vuex-with-tests/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/jsx-router-vuex/index.html b/playground/jsx-router-vuex/index.html index 11603f87..030a6ff5 100644 --- a/playground/jsx-router-vuex/index.html +++ b/playground/jsx-router-vuex/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/jsx-router/index.html b/playground/jsx-router/index.html index 11603f87..030a6ff5 100644 --- a/playground/jsx-router/index.html +++ b/playground/jsx-router/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/jsx/index.html b/playground/jsx/index.html index 11603f87..030a6ff5 100644 --- a/playground/jsx/index.html +++ b/playground/jsx/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/router-vuex-with-tests/index.html b/playground/router-vuex-with-tests/index.html index 11603f87..030a6ff5 100644 --- a/playground/router-vuex-with-tests/index.html +++ b/playground/router-vuex-with-tests/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/router-vuex/index.html b/playground/router-vuex/index.html index 11603f87..030a6ff5 100644 --- a/playground/router-vuex/index.html +++ b/playground/router-vuex/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/router/index.html b/playground/router/index.html index 11603f87..030a6ff5 100644 --- a/playground/router/index.html +++ b/playground/router/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/vuex-with-tests/index.html b/playground/vuex-with-tests/index.html index 11603f87..030a6ff5 100644 --- a/playground/vuex-with-tests/index.html +++ b/playground/vuex-with-tests/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/vuex/index.html b/playground/vuex/index.html index 11603f87..030a6ff5 100644 --- a/playground/vuex/index.html +++ b/playground/vuex/index.html @@ -8,6 +8,6 @@
- + diff --git a/playground/with-tests/index.html b/playground/with-tests/index.html index 11603f87..030a6ff5 100644 --- a/playground/with-tests/index.html +++ b/playground/with-tests/index.html @@ -8,6 +8,6 @@
- + diff --git a/template/base/index.html b/template/base/index.html index 11603f87..030a6ff5 100644 --- a/template/base/index.html +++ b/template/base/index.html @@ -8,6 +8,6 @@
- + -- 2.39.5