Skip to content

Commit 04f8c20

Browse files
committed
chore: build for production
1 parent 2adee99 commit 04f8c20

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

dist/index.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
const path = require('pathe');
34
const postcss = require('postcss');
45
const isUrl = require('is-url-superb');
56
const defu = require('defu');
@@ -9,6 +10,7 @@ const srcset = require('srcset');
910

1011
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
1112

13+
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
1214
const postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
1315
const isUrl__default = /*#__PURE__*/_interopDefaultCompat(isUrl);
1416
const safe__default = /*#__PURE__*/_interopDefaultCompat(safe);
@@ -156,7 +158,7 @@ const plugin = (options = {}) => (tree) => {
156158
if (isUrl__default(node.attrs[attribute])) {
157159
return node;
158160
}
159-
node.attrs[attribute] = typeof value === "boolean" ? options.url + node.attrs[attribute] : value + node.attrs[attribute];
161+
node.attrs[attribute] = typeof value === "boolean" ? isUrl__default(options.url) ? options.url + node.attrs[attribute] : path__default.join(options.url, node.attrs[attribute]) : isUrl__default(value) ? value + node.attrs[attribute] : path__default.join(value, node.attrs[attribute]);
160162
};
161163
const prependUrl = (value, url) => {
162164
const { css } = postcss__default([postcssBaseurl({ base: url })]).process(`div { ${value} }`, { parser: safe__default });

dist/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'pathe';
12
import postcss from 'postcss';
23
import isUrl from 'is-url-superb';
34
import { defu } from 'defu';
@@ -148,7 +149,7 @@ const plugin = (options = {}) => (tree) => {
148149
if (isUrl(node.attrs[attribute])) {
149150
return node;
150151
}
151-
node.attrs[attribute] = typeof value === "boolean" ? options.url + node.attrs[attribute] : value + node.attrs[attribute];
152+
node.attrs[attribute] = typeof value === "boolean" ? isUrl(options.url) ? options.url + node.attrs[attribute] : path.join(options.url, node.attrs[attribute]) : isUrl(value) ? value + node.attrs[attribute] : path.join(value, node.attrs[attribute]);
152153
};
153154
const prependUrl = (value, url) => {
154155
const { css } = postcss([postcssBaseurl({ base: url })]).process(`div { ${value} }`, { parser: safe });

0 commit comments

Comments
 (0)