Skip to content

Commit

Permalink
Chore(Project-Scaffold): Change rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
nurulakbaral committed Jul 13, 2024
1 parent b29e62c commit 6dd4944
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "nx/presets/npm.json",
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"nxCloudAccessToken": "NDAyNWVkZmMtNDhiNS00OWQ0LWI4MTctYjJjYWQ0MDJiZGY0fHJlYWQtd3JpdGU="
"nxCloudAccessToken": ""
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"devDependencies": {
"@nx/js": "19.4.2",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"glob": "^11.0.0",
"minimist": "^1.2.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/project-scaffold/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let __dirname = dirname(fileURLToPath(import.meta.url))
Plop.prepare(
{
cwd: argv.cwd,
configPath: path.join(__dirname, '../dist/plopfile.js'),
configPath: path.join(__dirname, 'plopfile.js'),
preload: argv.preload || [],
completion: argv.completion,
},
Expand Down
21 changes: 18 additions & 3 deletions packages/project-scaffold/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import path from 'node:path'
import * as path from 'node:path'
import { fileURLToPath } from 'node:url'
import { type RollupOptions } from 'rollup'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
import { globSync } from 'glob'

const SOURCE_DIR = 'src'
Expand Down Expand Up @@ -31,8 +33,21 @@ const config: RollupOptions = {
format: 'esm',
sourcemap: false,
},
external: [],
plugins: [commonjs(), typescript()],
external: ['plop', 'minimist'],
onwarn: (warning, warn) => {
if (warning.code === 'CIRCULAR_DEPENDENCY' || warning.code === 'EMPTY_BUNDLE') {
return
}
warn(warning)
},
plugins: [
nodeResolve({
preferBuiltins: true,
}),
json(),
commonjs(),
typescript(),
],
}

export default config
62 changes: 62 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6dd4944

Please sign in to comment.