Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
Kemosabert committed Aug 16, 2023
1 parent 740c186 commit 059a955
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Plugin } from 'vite';

interface PreloadOptions {
/**
* @default true
*/
includeJs: boolean;
/**
* @default true
*/
includeCss: boolean;
isPrefetch: boolean;
prettierSettings: any;
Expand Down
11 changes: 7 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
Expand Down Expand Up @@ -79,8 +83,8 @@ var appendToDom = (dom, link) => dom.window.document.head.appendChild(link);

// src/index.ts
var import_prettier = __toESM(require("prettier"));
var jsFilter = (0, import_pluginutils.createFilter)(["**/*.*.js"]);
var cssFilter = (0, import_pluginutils.createFilter)(["**/*.*.css"]);
var jsFilter = (0, import_pluginutils.createFilter)(["**/*-*.js"]);
var cssFilter = (0, import_pluginutils.createFilter)(["**/*-*.css"]);
function VitePluginPreloadAll(options) {
let viteConfig;
const mergedOptions = { ...defaultOptions, ...options };
Expand All @@ -97,6 +101,7 @@ function VitePluginPreloadAll(options) {
if (!ctx.bundle) {
return html;
}
const base = viteConfig.base ?? "";
const dom = createDom(html);
const existingLinks = getExistingLinks(dom);
let additionalModules = [];
Expand Down Expand Up @@ -147,5 +152,3 @@ function VitePluginPreloadAll(options) {
}
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
5 changes: 3 additions & 2 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ var appendToDom = (dom, link) => dom.window.document.head.appendChild(link);

// src/index.ts
import prettier from "prettier";
var jsFilter = createFilter(["**/*.*.js"]);
var cssFilter = createFilter(["**/*.*.css"]);
var jsFilter = createFilter(["**/*-*.js"]);
var cssFilter = createFilter(["**/*-*.css"]);
function VitePluginPreloadAll(options) {
let viteConfig;
const mergedOptions = { ...defaultOptions, ...options };
Expand All @@ -65,6 +65,7 @@ function VitePluginPreloadAll(options) {
if (!ctx.bundle) {
return html;
}
const base = viteConfig.base ?? "";
const dom = createDom(html);
const existingLinks = getExistingLinks(dom);
let additionalModules = [];
Expand Down

0 comments on commit 059a955

Please sign in to comment.