diff --git a/package.json b/package.json index eb823eb..0bac487 100644 --- a/package.json +++ b/package.json @@ -31,10 +31,12 @@ "vue": "3.x" }, "module": "./dist/redux-vuex.es.js", + "main": "./dist/redux-vuex.cjs.js", "types": "./dist/typings/index.d.ts", "exports": { ".": { "import": "./dist/redux-vuex.es.js", + "require": "./dist/redux-vuex.cjs.js", "types": "./dist/typings/index.d.ts" } }, diff --git a/vite.config.js b/vite.config.js index cc19794..ae67058 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,7 +6,7 @@ import vue from '@vitejs/plugin-vue'; export default defineConfig({ build: { lib: { - formats: ['es'], + formats: ['es', 'cjs'], entry: resolve(__dirname, 'src', 'index.ts'), name: 'ReduxVuex', fileName: (format) => `redux-vuex.${format}.js`,