Skip to content

Commit

Permalink
custom rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
olayway committed Mar 9, 2023
1 parent ff877b9 commit 5d4cb5c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
},
"type": "module",
"main": "./dist/index.js",
"exports": {
"./*": "./*",
"./ui": "./ui.js",
"./utils": "./utils.js",
"./config": "./config.js"
},
"dependencies": {
"@docsearch/react": "^3.3.3",
"@floating-ui/react-dom": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"next-themes"
],
"generateExportsField": true,
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"rollupConfig": "packages/core/rollup.config.cjs",
"compiler": "babel",
"assets": [
{
Expand Down
22 changes: 22 additions & 0 deletions packages/core/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const nrwlConfig = require("@nrwl/react/plugins/bundle-rollup");

module.exports = (config) => {
const nxConfig = nrwlConfig(config);

return Object.assign(nxConfig, {
plugins: nxConfig.plugins,
input: {
index: "packages/core/src/index.ts",
ui: "packages/core/src/ui/index.ts",
utils: "packages/core/src/utils/index.ts",
config: "packages/core/src/config/index.ts",
},
output: [
{
format: "esm",
dir: "packages/core/dist",
exports: "auto",
},
],
});
};

0 comments on commit 5d4cb5c

Please sign in to comment.