chore: refactor build configuration to support multiple entry points and update package exports accordingly
This commit is contained in:
+8
-6
@@ -10,20 +10,22 @@
|
|||||||
"security"
|
"security"
|
||||||
],
|
],
|
||||||
"name": "vite-plugin-component-locker",
|
"name": "vite-plugin-component-locker",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/crypto-locker.umd.cjs",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/crypto-locker.js",
|
"module": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/crypto-locker.js",
|
"import": "./dist/index.js",
|
||||||
"require": "./dist/crypto-locker.umd.cjs"
|
"require": "./dist/index.cjs"
|
||||||
},
|
},
|
||||||
"./plugin": {
|
"./plugin": {
|
||||||
"types": "./dist/plugin.d.ts",
|
"types": "./dist/plugin.d.ts",
|
||||||
"default": "./src/plugin.ts"
|
"import": "./dist/plugin.js",
|
||||||
|
"require": "./dist/plugin.cjs",
|
||||||
|
"default": "./dist/plugin.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
+15
-3
@@ -6,12 +6,24 @@ export default defineConfig({
|
|||||||
plugins: [react({ jsxRuntime: "automatic" })],
|
plugins: [react({ jsxRuntime: "automatic" })],
|
||||||
build: {
|
build: {
|
||||||
lib: {
|
lib: {
|
||||||
entry: resolve(__dirname, "src/index.ts"),
|
entry: {
|
||||||
|
index: resolve(__dirname, "src/index.ts"),
|
||||||
|
plugin: resolve(__dirname, "src/plugin.ts"),
|
||||||
|
},
|
||||||
name: "CryptoLocker",
|
name: "CryptoLocker",
|
||||||
fileName: "crypto-locker",
|
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ["react", "react-dom", "react/jsx-runtime", "crypto-js"],
|
external: [
|
||||||
|
"react",
|
||||||
|
"react-dom",
|
||||||
|
"react/jsx-runtime",
|
||||||
|
"crypto-js",
|
||||||
|
"esbuild",
|
||||||
|
"fs/promises",
|
||||||
|
"path",
|
||||||
|
"url",
|
||||||
|
"mime-types"
|
||||||
|
],
|
||||||
output: {
|
output: {
|
||||||
globals: {
|
globals: {
|
||||||
react: "React",
|
react: "React",
|
||||||
|
|||||||
Reference in New Issue
Block a user