tailwindcss-injector 0.1.1 → 0.1.2

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/postcss.cjs CHANGED
@@ -434,11 +434,10 @@ var creator = (options) => {
434
434
  postcssPlugin: "post",
435
435
  async Once(root, helpers) {
436
436
  if (filter(_optionalChain([root, 'access', _ => _.source, 'optionalAccess', _2 => _2.input]))) {
437
- let _root = root;
438
437
  for (const params of directiveParams) {
439
438
  const node = root.nodes.find((x) => x.type === "atrule" && x.params === params);
440
439
  if (!node) {
441
- _root = _root.prepend(helpers.atRule({ name: "tailwind", params }));
440
+ root.prepend(helpers.atRule({ name: "tailwind", params }));
442
441
  }
443
442
  }
444
443
  const cfg = typeof config === "function" ? config(_optionalChain([root, 'access', _3 => _3.source, 'optionalAccess', _4 => _4.input])) : config;
@@ -465,10 +464,11 @@ var creator = (options) => {
465
464
  }
466
465
  }
467
466
  }
468
- const { root: newRoot } = await _postcss2.default.call(void 0, [
467
+ await _postcss2.default.call(void 0, [
469
468
  _tailwindcss2.default.call(void 0, tailwindcssConfig)
470
- ]).process(_root);
471
- root.replaceWith(newRoot);
469
+ ]).process(root, {
470
+ from: _optionalChain([root, 'access', _7 => _7.source, 'optionalAccess', _8 => _8.input, 'access', _9 => _9.file])
471
+ });
472
472
  }
473
473
  }
474
474
  }
package/dist/postcss.js CHANGED
@@ -434,11 +434,10 @@ var creator = (options) => {
434
434
  postcssPlugin: "post",
435
435
  async Once(root, helpers) {
436
436
  if (filter(root.source?.input)) {
437
- let _root = root;
438
437
  for (const params of directiveParams) {
439
438
  const node = root.nodes.find((x) => x.type === "atrule" && x.params === params);
440
439
  if (!node) {
441
- _root = _root.prepend(helpers.atRule({ name: "tailwind", params }));
440
+ root.prepend(helpers.atRule({ name: "tailwind", params }));
442
441
  }
443
442
  }
444
443
  const cfg = typeof config === "function" ? config(root.source?.input) : config;
@@ -465,10 +464,11 @@ var creator = (options) => {
465
464
  }
466
465
  }
467
466
  }
468
- const { root: newRoot } = await postcss([
467
+ await postcss([
469
468
  tailwindcss(tailwindcssConfig)
470
- ]).process(_root);
471
- root.replaceWith(newRoot);
469
+ ]).process(root, {
470
+ from: root.source?.input.file
471
+ });
472
472
  }
473
473
  }
474
474
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tailwindcss-injector",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "description": "tsup(esbuild) build package template",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",