@magicdima/vite-plugin-csp 0.1.3 → 0.1.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.d.ts CHANGED
@@ -29,5 +29,4 @@ export interface CSPPluginOptions {
29
29
  */
30
30
  policy?: string;
31
31
  }
32
- declare function cspPlugin(options?: CSPPluginOptions): Plugin;
33
- export default cspPlugin;
32
+ export declare function contentSecurityPolicy(options?: CSPPluginOptions): Plugin;
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contentSecurityPolicy = contentSecurityPolicy;
3
4
  const defaultDirectives = {
4
5
  "default-src": "'self'",
5
6
  "script-src": ["'self'"],
@@ -32,7 +33,7 @@ function buildCSPHeader(directives) {
32
33
  }
33
34
  return policies.join("; ");
34
35
  }
35
- function cspPlugin(options = {}) {
36
+ function contentSecurityPolicy(options = {}) {
36
37
  const { directives = {}, enabled: includeCsp = true, policy: additionalPolicy, } = options;
37
38
  let resolvedDirectives;
38
39
  return {
@@ -67,4 +68,3 @@ function cspPlugin(options = {}) {
67
68
  },
68
69
  };
69
70
  }
70
- exports.default = cspPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicdima/vite-plugin-csp",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",