@magicdima/vite-plugin-csp 0.1.4 → 0.1.7

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/README.md CHANGED
@@ -64,10 +64,6 @@ Whether to enable CSP injection. Defaults to `true`.
64
64
 
65
65
  When disabled, the plugin will not inject CSP meta tag.
66
66
 
67
- ### `policy`
68
-
69
- An additional CSP policy string to append to the generated policy. Useful for complex policies that don't fit the directive object structure.
70
-
71
67
  ## How it works
72
68
 
73
69
  The plugin injects a `<meta http-equiv="Content-Security-Policy">` tag into the HTML head at build time.
package/dist/index.d.ts CHANGED
@@ -29,4 +29,4 @@ export interface CSPPluginOptions {
29
29
  */
30
30
  policy?: string;
31
31
  }
32
- export default function cspPlugin(options?: CSPPluginOptions): Plugin;
32
+ export declare function contentSecurityPolicy(options?: CSPPluginOptions): Plugin;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = cspPlugin;
3
+ exports.contentSecurityPolicy = contentSecurityPolicy;
4
4
  const defaultDirectives = {
5
5
  "default-src": "'self'",
6
6
  "script-src": ["'self'"],
@@ -33,7 +33,7 @@ function buildCSPHeader(directives) {
33
33
  }
34
34
  return policies.join("; ");
35
35
  }
36
- function cspPlugin(options = {}) {
36
+ function contentSecurityPolicy(options = {}) {
37
37
  const { directives = {}, enabled: includeCsp = true, policy: additionalPolicy, } = options;
38
38
  let resolvedDirectives;
39
39
  return {
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "@magicdima/vite-plugin-csp",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "",
5
+ "keywords": [],
6
+ "homepage": "https://github.com/dmshvetsov/vite-plugin-csp#readme",
7
+ "bugs": {
8
+ "url": "https://github.com/dmshvetsov/vite-plugin-csp/issues"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/dmshvetsov/vite-plugin-csp.git"
13
+ },
14
+ "license": "ISC",
5
15
  "main": "./dist/index.js",
6
16
  "types": "./dist/index.d.ts",
7
17
  "files": [
@@ -11,15 +21,12 @@
11
21
  "scripts": {
12
22
  "build": "tsc"
13
23
  },
14
- "peerDependencies": {
15
- "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
16
- },
17
24
  "devDependencies": {
18
25
  "typescript": "^5.9.3",
19
26
  "vite": "^7.3.0"
20
27
  },
21
- "keywords": [],
22
- "author": "",
23
- "license": "ISC",
28
+ "peerDependencies": {
29
+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
30
+ },
24
31
  "packageManager": "pnpm@10.17.1"
25
32
  }