From 113b8ea7797672d0b8bbbceb0fd817a18ba9181c Mon Sep 17 00:00:00 2001 From: Marcin Moch Date: Sat, 9 Dec 2023 17:34:17 +0100 Subject: [PATCH] feat(no-inject-style): Added second build witouth style injection --- README.md | 3 +++ package.json | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0312549..dc63c01 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ yarn add react-multi-select-component # yarn ```tsx import React, { useState } from "react"; import { MultiSelect } from "react-multi-select-component"; +// or without style injection (in the presence of Content Security Policy issues) +// import { MultiSelect } from "react-multi-select-component/no-inject-style"; +// import "react-multi-select-component/no-inject-style/index.css"; const options = [ { label: "Grapes 🍇", value: "grapes" }, diff --git a/package.json b/package.json index 1fccbf3..db1d81b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "module": "./dist/esm/index.js", "types": "./dist/index.d.ts", "scripts": { - "build": "tsup src/index.tsx --inject-style --legacy-output --minify --format esm,cjs --dts --external react", + "build:no-inject-style": "tsup src/index.tsx --outDir dist/no-inject-style --legacy-output --minify --format esm,cjs --dts --external react", + "build:inject-style": "tsup src/index.tsx --inject-style --legacy-output --minify --format esm,cjs --dts --external react", + "build": "yarn run build:inject-style && yarn run build:no-inject-style", "dev": "tsup src/index.tsx --inject-style --legacy-output --format esm,cjs --watch --dts --external react", "lint": "eslint src --fix", "size": "size-limit",