Complete main UI #37
@@ -58,7 +58,7 @@ class Compiler {
|
|||||||
format: 'esm',
|
format: 'esm',
|
||||||
metafile: true,
|
metafile: true,
|
||||||
write: false,
|
write: false,
|
||||||
plugins: [this.fileResolverPlugin(files, importMap)]
|
plugins: [this.fileResolverPlugin(files, importMap, entryPoints)]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -66,12 +66,16 @@ class Compiler {
|
|||||||
esbuild.stop()
|
esbuild.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fileResolverPlugin = (files: IFiles, importMap: IImportMap): Plugin => {
|
private fileResolverPlugin = (
|
||||||
|
files: IFiles,
|
||||||
|
importMap: IImportMap,
|
||||||
|
entryPoints: string[]
|
||||||
|
): Plugin => {
|
||||||
return {
|
return {
|
||||||
name: 'file-resolver-plugin',
|
name: 'file-resolver-plugin',
|
||||||
setup: (build: PluginBuild) => {
|
setup: (build: PluginBuild) => {
|
||||||
build.onResolve({ filter: /.*/ }, (args: esbuild.OnResolveArgs) => {
|
build.onResolve({ filter: /.*/ }, (args: esbuild.OnResolveArgs) => {
|
||||||
if (args.path === ENTRY_FILE_NAME) {
|
if (entryPoints.includes(args.path)) {
|
||||||
return {
|
return {
|
||||||
namespace: 'OxygenToolbox',
|
namespace: 'OxygenToolbox',
|
||||||
path: args.path
|
path: args.path
|
||||||
|
|||||||
Reference in New Issue
Block a user