diff --git a/package.json b/package.json index da47800ff..a82cb1f36 100644 --- a/package.json +++ b/package.json @@ -28,14 +28,23 @@ "test-ci": "TZ=UTC vue-cli-service test:e2e --mode test --headless --browser chrome -- --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml", "test-unit": "JEST_JUNIT_OUTPUT_DIR=test_summary_reports/jest/ vue-cli-service test:unit --ci --runInBand --reporters=default --reporters=jest-junit" }, - "main": "./dist/modeler.common.js", + "main": "./dist/modeler.umd.js", + "module": "./dist/modeler.es.js", + "exports": { + ".": { + "import": { + "import": "./dist/modeler.es.js", + "require": "./dist/modeler.umd.js" + } + }, + "./dist/modeler.css": { + "import": "./dist/modeler.css", + "require": "./dist/modeler.css" + } + }, "files": [ - "dist/*", - "src/*", - "public/*", - "*.json", - "*.js", - "blank.bpmn" + "dist", + "src" ], "dependencies": { "@babel/plugin-proposal-private-methods": "^7.12.1", diff --git a/src/components/index.js b/src/components/index.js index f9f1e901e..c7f054fec 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -24,4 +24,4 @@ function install(Vue) { } } -export default { install }; +export default install; diff --git a/vite.config.js b/vite.config.js index 4f3231c17..b9085f076 100644 --- a/vite.config.js +++ b/vite.config.js @@ -36,7 +36,6 @@ export default defineConfig({ }, build: { cssCodeSplit: false, - sourcemap: true, lib: { entry: resolve(__dirname, 'src/components/index.js'), name: libraryName, @@ -45,15 +44,19 @@ export default defineConfig({ rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library - external: ['vue', 'moment', 'moment-timezone', '@processmaker'], + external: ['vue', 'moment', 'moment-timezone', /^@processmaker\/(?!processmaker-bpmn-moddle).+$/, 'lodash'], output: { exports: 'named', + assetFileNames: 'modeler.[ext]', // Provide global variables to use in the UMD build // for externalized deps globals: { vue: 'Vue', moment: 'moment', 'moment-timezone': 'moment-timezone', + '@processmaker/screen-builder': '@processmaker/screen-builder', + '@processmaker/vue-form-elements': '@processmaker/vue-form-elements', + lodash: 'lodash', }, }, },