Skip to content

Commit

Permalink
feat: remove gen template script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Jan 1, 2024
1 parent 9b1db65 commit c8156ca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 44 deletions.
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@
}
},
"scripts": {
"dev": "run-p dev:template dev:lib",
"dev:lib": "tsup --watch",
"dev:template": "cross-env WATCH=1 tsx watch ./scripts/template.ts",
"build": "run-p build:template build:lib",
"build:lib": "tsup",
"build:template": "tsx ./scripts/template.ts",
"dev": "tsup --watch",
"build": "tsup",
"lint": "run-s lint:eslint lint:stylelint lint:prettier",
"lint:eslint": "eslint \"{src,examples}/**/*.{js,cjs,ts,tsx,vue}\" *.{js,cjs,ts} --fix --cache",
"lint:stylelint": "stylelint \"examples/**/*.{vue,css,less,html}\" --fix --cache",
Expand Down
37 changes: 0 additions & 37 deletions scripts/template.ts

This file was deleted.

4 changes: 4 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.html' {
const content: string;
export default content;
}
2 changes: 1 addition & 1 deletion src/loading/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PluginOption } from 'vite';
import { parse as htmlParser } from 'node-html-parser';
import { LOADING_PLUGIN_NAME } from '../constants';
import loadingHtml from './template';
import loadingHtml from './template.html';
import { type HtmlLoadingOptions } from './types';

export * from './types';
Expand Down
3 changes: 3 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default defineConfig({
format: ['esm', 'cjs'],
target: ['es2021', 'node16'],
external: ['vite'],
loader: {
'.html': 'text',
},
clean: true,
dts: true,
splitting: true,
Expand Down

0 comments on commit c8156ca

Please sign in to comment.