@posthog/rollup-plugin 1.1.2 → 1.1.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAC7E,OAAO,EAAiC,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAG/E,MAAM,WAAW,0BAA0B;IACvC,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,UAAU,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC9B,CAAA;CACJ;AAgBD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,WAAW,EAAE,0BAA0B,GAqD1E,MAAM,CACd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAC7E,OAAO,EAAiC,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAG/E,MAAM,WAAW,0BAA0B;IACvC,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,UAAU,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC9B,CAAA;CACJ;AAgBD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,WAAW,EAAE,0BAA0B,GAkD1E,MAAM,CACd"}
package/dist/index.js CHANGED
@@ -20,18 +20,16 @@ function posthogRollupPlugin(userOptions) {
20
20
  'process'
21
21
  ];
22
22
  const cliPath = posthogOptions.cliBinaryPath;
23
- if (options.dir) {
24
- const directory = path.resolve(options.dir);
25
- args.push('--directory', directory);
26
- for(const fileName in bundle){
27
- const chunk = bundle[fileName];
28
- if ('chunk' === chunk.type) args.push('--include', `**/${fileName}`);
23
+ if (options.dir) for(const fileName in bundle){
24
+ const chunk = bundle[fileName];
25
+ if ('chunk' === chunk.type) {
26
+ const chunkPath = path.resolve(options.dir, fileName);
27
+ args.push('--file', chunkPath);
29
28
  }
30
- } else if (options.file) {
29
+ }
30
+ else if (options.file) {
31
31
  const filePath = path.resolve(options.file);
32
- const parentDirectory = path.dirname(filePath);
33
- args.push('--directory', parentDirectory);
34
- args.push('--include', filePath);
32
+ args.push('--file', filePath);
35
33
  }
36
34
  if (posthogOptions.sourcemaps.project) args.push('--project', posthogOptions.sourcemaps.project);
37
35
  if (posthogOptions.sourcemaps.version) args.push('--version', posthogOptions.sourcemaps.version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/rollup-plugin",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "PostHog Rollup plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  "dist"
16
16
  ],
17
17
  "dependencies": {
18
- "@posthog/cli": "~0.5.16",
19
- "@posthog/core": "1.7.1"
18
+ "@posthog/cli": "~0.5.17",
19
+ "@posthog/core": "1.8.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "rollup": ">= 4.0.0"
package/src/index.ts CHANGED
@@ -48,19 +48,16 @@ export default function posthogRollupPlugin(userOptions: PostHogRollupPluginOpti
48
48
  const args = ['sourcemap', 'process']
49
49
  const cliPath = posthogOptions.cliBinaryPath
50
50
  if (options.dir) {
51
- const directory = path.resolve(options.dir)
52
- args.push('--directory', directory)
53
51
  for (const fileName in bundle) {
54
52
  const chunk = bundle[fileName]
55
53
  if (chunk.type === 'chunk') {
56
- args.push('--include', `**/${fileName}`)
54
+ const chunkPath = path.resolve(options.dir, fileName)
55
+ args.push('--file', chunkPath)
57
56
  }
58
57
  }
59
58
  } else if (options.file) {
60
59
  const filePath = path.resolve(options.file)
61
- const parentDirectory = path.dirname(filePath)
62
- args.push('--directory', parentDirectory)
63
- args.push('--include', filePath)
60
+ args.push('--file', filePath)
64
61
  }
65
62
  if (posthogOptions.sourcemaps.project) {
66
63
  args.push('--project', posthogOptions.sourcemaps.project)