Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix #4 ts support #5

Merged
merged 6 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

package/*.d.ts

src/*.d.ts
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"lib": "vue-cli-service build --target lib --name vue3-tabs-chrome ./package/index.ts"
"moveTs": "scp ./package/index.d.ts ./dist/vue3-tabs-chrome.common.d.ts && scp ./package/vue3-tabs-chrome.vue.d.ts ./dist/vue3-tabs-chrome.vue.d.ts",
"lib": "vue-cli-service build --target lib --name vue3-tabs-chrome ./package/index.ts && npm run moveTs"
},
"files": [
"dist/**.*"
Expand Down
4 changes: 2 additions & 2 deletions package/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { App, Plugin } from 'vue'
import Vue3TabsChrome from './vue3-tabs-chrome.vue'
import Vue3TabsChrome, { Tab } from './vue3-tabs-chrome.vue'
import './theme-dark.less'

const install = (app: App) => {
Expand All @@ -8,6 +8,6 @@ const install = (app: App) => {

Vue3TabsChrome.install = install

export { Vue3TabsChrome }
export { Vue3TabsChrome, Tab }

export default Vue3TabsChrome as unknown as Plugin
2 changes: 1 addition & 1 deletion package/render-temp.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script>
<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"target": "esnext",
"module": "esnext",
"strict": true,
Expand Down Expand Up @@ -38,4 +39,4 @@
"exclude": [
"node_modules"
]
}
}
18 changes: 17 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,21 @@ module.exports = {
productionSourceMap: false,
publicPath: process.env.NODE_ENV === 'production'
? '/vue3-tabs-chrome/'
: '/'
: '/',
chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.module.rule('ts').uses.delete('cache-loader');
config.module
.rule('ts')
.use('ts-loader')
.loader('ts-loader')
.tap(options => ({
...options,
transpileOnly: false,
happyPackMode: false
}));
config.output.libraryExport = 'default';
}
},
parallel: false
}
2,620 changes: 1,310 additions & 1,310 deletions yarn.lock

Large diffs are not rendered by default.