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.
- package/dist/page_compiler.mjs +16 -5
- package/package.json +1 -1
package/dist/page_compiler.mjs
CHANGED
|
@@ -663,11 +663,22 @@ var build = async () => {
|
|
|
663
663
|
const projectFiles = getProjectFiles(options.pagesDirectory);
|
|
664
664
|
const start = performance.now();
|
|
665
665
|
{
|
|
666
|
-
const
|
|
667
|
-
name: "external-
|
|
666
|
+
const externalPackagesPlugin = {
|
|
667
|
+
name: "external-packages",
|
|
668
668
|
setup(build2) {
|
|
669
|
-
build2.onResolve({ filter: /^[^./]/ }, (args) => {
|
|
670
|
-
|
|
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: [
|
|
690
|
+
plugins: [externalPackagesPlugin],
|
|
680
691
|
loader: {
|
|
681
692
|
".ts": "ts"
|
|
682
693
|
},
|