elegance-js 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -663,11 +663,22 @@ var build = async () => {
663
663
  const projectFiles = getProjectFiles(options.pagesDirectory);
664
664
  const start = performance.now();
665
665
  {
666
- const externalBareImportsPlugin = {
667
- name: "external-bare-imports",
666
+ const externalPackagesPlugin = {
667
+ name: "external-packages",
668
668
  setup(build2) {
669
- build2.onResolve({ filter: /^[^./]/ }, (args) => {
670
- return { path: args.path, external: true };
669
+ build2.onResolve({ filter: /^[^./]/ }, async (args) => {
670
+ if (args.path[0] === "." || args.path[0] === "/") {
671
+ return;
672
+ }
673
+ const resolved = await build2.resolve(args.path, {
674
+ kind: args.kind,
675
+ resolveDir: args.resolveDir,
676
+ importer: args.importer
677
+ });
678
+ if (resolved.path && /\/node_modules\//.test(resolved.path)) {
679
+ return { path: args.path, external: true };
680
+ }
681
+ return resolved;
671
682
  });
672
683
  }
673
684
  };
@@ -676,7 +687,7 @@ var build = async () => {
676
687
  bundle: true,
677
688
  outdir: DIST_DIR,
678
689
  outExtension: { ".js": ".mjs" },
679
- plugins: [externalBareImportsPlugin],
690
+ plugins: [externalPackagesPlugin],
680
691
  loader: {
681
692
  ".ts": "ts"
682
693
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elegance-js",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Web-Framework",
5
5
  "type": "module",
6
6
  "bin": {