fix: 修复es服务地址配置
This commit is contained in:
@@ -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
@@ -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": [
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user