fix: 修复es服务地址配置

This commit is contained in:
tianyu
2024-03-12 00:47:03 +08:00
parent b3ed0101bb
commit dc47817dbb
4 changed files with 6 additions and 3 deletions
+2
View File
@@ -44,6 +44,8 @@ const msg = ref('我是vue!')
getFileContent: (path) => {
return Compiler.getFileContent(path, files)
},
},{
esmServiceUrl:'https://pdn.zijieapi.com/esm/bv'
})
compiler.createApp('/main.js').mount('#app')
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@rainetian/esbuild-wasm-compiler",
"version": "0.0.14",
"version": "0.0.15",
"private": false,
"description": "File Resolution for Esbuild running in the Browser",
"keywords": [
+1 -1
View File
@@ -61,7 +61,7 @@ export class Compiler {
let packageJson = pkgJson || this.options?.packageJson
if (packageJson) {
const dependencies = packageJson.dependencies
modulePath = getEsmUrl(dependencies || null, args.path)
modulePath = getEsmUrl(dependencies || null, args.path, this.esmServiceUrl)
if (modulePath.endsWith('.css')) {
return {
path: '/' + modulePath,
+2 -1
View File
@@ -1,7 +1,8 @@
import * as esbuild from 'esbuild-wasm'
import { compileFile } from './vue.compiler'
// 字节地址 https://pdn.zijieapi.com/esm/bv
// unpkg https://unpkg.com/
// 字节 https://pdn.zijieapi.com/esm/bv
export const ESM_SERVER_URL = 'https://esm.sh'
export const css2Js = async (name: string, value?: string) => {