vite-plugin-qingkuai 1.0.4 → 1.0.5

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/index.cjs CHANGED
@@ -100,10 +100,10 @@ function qingkuaiPlugin() {
100
100
  let viteConfig;
101
101
  const compileResultCache = /* @__PURE__ */ new Map();
102
102
  const qingkuaiConfigurations = /* @__PURE__ */ new Map();
103
- const qingkuaiPackageServeRE = /node_modules\/\.vite\/deps\/chunk.*$/;
103
+ const qingkuaiPackageServeRE = /node_modules\/\.vite\/deps\/chunk-.*$/;
104
104
  const confIdentifierRE = /__qk_expose_(?:dependencies|destructions)__/g;
105
105
  const styleIdRE = /^virtual:\[\d+\].*?\.qk.(?:css|s[ac]ss|less|stylus|postcss)\?\d{13}$/;
106
- const qingkuaiPackageBuildRE = /node_modules\/qingkuai\/dist\/esm\/(?:chunks|runtime)\/\w+\.js$/;
106
+ const qingkuaiPackageBuildRE = /(?:node_modules)?\/qingkuai\/dist\/esm\/(?:chunks|runtime)\/\w+\.js$/;
107
107
  return {
108
108
  name: "qingkuai-compiler",
109
109
  config(_, env) {
@@ -189,7 +189,7 @@ function qingkuaiPlugin() {
189
189
  async transform(src, id) {
190
190
  const qingkuaiConfig = getQingkuaiConfiguration(id);
191
191
  if (!id.endsWith(".qk")) {
192
- if (isDev && qingkuaiPackageServeRE.test(id) || !isDev && qingkuaiPackageBuildRE.test(id)) {
192
+ if (qingkuaiPackageServeRE.test(id) || qingkuaiPackageBuildRE.test(id)) {
193
193
  const ret = src.replace(confIdentifierRE, (s) => {
194
194
  switch (s) {
195
195
  case "__qk_expose_dependencies__":
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Plugin } from 'vite';
1
+ import { PluginOption } from 'vite';
2
2
 
3
- declare function qingkuaiPlugin(): Plugin;
3
+ declare function qingkuaiPlugin(): PluginOption;
4
4
 
5
5
  export { qingkuaiPlugin as default };
package/dist/index.js CHANGED
@@ -98,10 +98,10 @@ function qingkuaiPlugin() {
98
98
  let viteConfig;
99
99
  const compileResultCache = /* @__PURE__ */ new Map();
100
100
  const qingkuaiConfigurations = /* @__PURE__ */ new Map();
101
- const qingkuaiPackageServeRE = /node_modules\/\.vite\/deps\/chunk.*$/;
101
+ const qingkuaiPackageServeRE = /node_modules\/\.vite\/deps\/chunk-.*$/;
102
102
  const confIdentifierRE = /__qk_expose_(?:dependencies|destructions)__/g;
103
103
  const styleIdRE = /^virtual:\[\d+\].*?\.qk.(?:css|s[ac]ss|less|stylus|postcss)\?\d{13}$/;
104
- const qingkuaiPackageBuildRE = /node_modules\/qingkuai\/dist\/esm\/(?:chunks|runtime)\/\w+\.js$/;
104
+ const qingkuaiPackageBuildRE = /(?:node_modules)?\/qingkuai\/dist\/esm\/(?:chunks|runtime)\/\w+\.js$/;
105
105
  return {
106
106
  name: "qingkuai-compiler",
107
107
  config(_, env) {
@@ -187,7 +187,7 @@ function qingkuaiPlugin() {
187
187
  async transform(src, id) {
188
188
  const qingkuaiConfig = getQingkuaiConfiguration(id);
189
189
  if (!id.endsWith(".qk")) {
190
- if (isDev && qingkuaiPackageServeRE.test(id) || !isDev && qingkuaiPackageBuildRE.test(id)) {
190
+ if (qingkuaiPackageServeRE.test(id) || qingkuaiPackageBuildRE.test(id)) {
191
191
  const ret = src.replace(confIdentifierRE, (s) => {
192
192
  switch (s) {
193
193
  case "__qk_expose_dependencies__":
@@ -1,2 +1,2 @@
1
- import type { Plugin } from "vite";
2
- export default function qingkuaiPlugin(): Plugin;
1
+ import type { PluginOption } from "vite";
2
+ export default function qingkuaiPlugin(): PluginOption;
@@ -1,5 +1,5 @@
1
1
  import type { SourceMap } from "./types";
2
- export declare function attachScopeForStyleSelectors(code: string, hash: string, map: SourceMap, sourceFile: string): Promise<{
2
+ export declare function attachScopeForStyleSelectors(code: string, hash: string, sourceFile: string, map: SourceMap | undefined): Promise<{
3
3
  code: string;
4
4
  mappings: string;
5
5
  }>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vite-plugin-qingkuai",
3
3
  "author": "mlgq",
4
4
  "license": "MIT",
5
- "version": "1.0.4",
5
+ "version": "1.0.5",
6
6
  "type": "module",
7
7
  "keywords": [
8
8
  "vite",