Skip to content

Commit

Permalink
Fix node-sql-parser cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
HeHang0 committed Dec 14, 2023
1 parent b5c5bd5 commit caec8c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 124 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches: ['master']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,7 +18,7 @@ permissions:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
group: 'pages'
cancel-in-progress: false

jobs:
Expand All @@ -33,12 +33,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/setup-node@v3

- name: Build
run: |
yarn
yarn build-only
echo '<html><head><script>let pathname=location.pathname.substring(9).split("/")[0];let redirect=pathname?`(location.search&amp;&amp;'&amp;'||'')redirect=${pathname}`:'';location.href="/devtoys"+(location.search||"?")+</script></head></html>' > devtoys/404.html
echo '<html><head><script>localStorage.setItem("devtoys-router-history",`"devtoys"`);let pathname=location.pathname.substring(9);let redirect=pathname?`${(location.search?"&":"?")}redirect=${pathname}`:"";location.href="/devtoys"+location.search+redirect;</script></head></html>' > devtoys/404.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
122 changes: 2 additions & 120 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,125 +13,6 @@ const plugins = [
monacoEditorPlugin({
languageWorkers: ['css', 'html', 'json', 'editorWorkerService']
}),
cdn({
isProduction: true,
modules: [
{
name: 'vue',
global: 'Vue',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/vue/3.3.4/vue.global.min.js'
},
{
name: 'vue-demi',
global: 'VueDemi',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/vue-demi/0.14.5/index.iife.min.js'
},
{
name: 'pinia',
global: 'Pinia',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/pinia/2.1.3/pinia.iife.min.js'
},
{
name: 'vue-router',
global: 'VueRouter',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/vue-router/4.2.1/vue-router.global.js'
},
{
name: 'element-plus',
global: 'ElementPlus',
spare: [
'https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.3.5/index.full.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/element-plus/2.3.5/index.min.css'
]
},
{
name: '@element-plus/icons-vue',
global: 'ElementPlusIconsVue',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/element-plus-icons-vue/2.1.0/global.iife.min.js'
},
{
name: 'marked',
global: 'Al',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/marked/5.0.3/marked.min.js'
},
{
name: 'highlight.js',
global: 'hljs',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js'
},
{
name: 'heic2any',
global: 'heic2any',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/heic2any/0.0.4/heic2any.min.js'
},
{
name: 'crypto-js',
global: 'CryptoJS',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js'
},
// {
// name: 'jsqr',
// global: 'jsQR',
// spare: 'https://unpkg.com/[email protected]/dist/jsQR.js'
// },
{
name: 'js-yaml',
global: 'jsyaml',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js'
},
{
name: 'moment',
global: 'moment',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment-with-locales.min.js'
},
// {
// name: 'qrcode',
// global: 'qrcode',
// spare: 'https://cdn.bootcdn.net/ajax/libs/qrcode/1.5.1/qrcode.min.js'
// },
{
name: 'sql-formatter',
global: 'sqlFormatter',
spare:
'https://cdnjs.cloudflare.com/ajax/libs/sql-formatter/12.2.1/sql-formatter.min.js'
},
{
name: 'he',
global: 'he',
spare: 'https://cdnjs.cloudflare.com/ajax/libs/he/1.2.0/he.min.js'
},
{
name: 'node-sql-parser',
global: 'NodeSQLParser',
spare: 'https://unpkg.com/node-sql-parser/umd/index.umd.js'
}
// {
// name: 'cron-parser',
// global: 'CronParser',
// spare: 'https://unpkg.com/[email protected]/lib/parser.js'
// },
// {
// name: 'exifr',
// global: 'exifr',
// spare: 'https://unpkg.com/[email protected]/dist/full.esm.mjs'
// }
],
preset: false,
transform(result: any) {
if (result.tag === 'script') result.defer = true;
}
}),
VitePWA({
manifest: {
name: 'DevToys',
Expand Down Expand Up @@ -286,7 +167,8 @@ if (process.env.NODE_ENV === 'production') {
{
name: 'node-sql-parser',
global: 'NodeSQLParser',
spare: 'https://unpkg.com/node-sql-parser/umd/index.umd.js'
spare:
'https://cdn.jsdelivr.net/npm/[email protected]/umd/index.umd.js'
}
// {
// name: 'cron-parser',
Expand Down

0 comments on commit caec8c5

Please sign in to comment.