Skip to content

Commit

Permalink
Merge pull request #56 from agiledigital-labs/feat/remove-rollup-plug…
Browse files Browse the repository at this point in the history
…in-execute-dependency

refactor: remove rollup-plugin-execute dependency
  • Loading branch information
dspasojevic authored Aug 30, 2021
2 parents ae5ce7b + f6eb703 commit 0b68542
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
13 changes: 0 additions & 13 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"rollup": "^2.45.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-execute": "^1.1.1",
"rollup-plugin-typescript2": "^0.30.0",
"ts-jest": "^27.0.3",
"tsconfig-paths-webpack-plugin": "^3.5.1",
Expand Down
18 changes: 9 additions & 9 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import typescript from 'rollup-plugin-typescript2';
import { join } from 'path';
import { readdirSync } from 'fs';
import execute from 'rollup-plugin-execute';
import del from 'rollup-plugin-delete';
import cleanup from 'rollup-plugin-cleanup';
import { spawnSync } from 'child_process';


const cliConfig = require('./config/cliConfig.json');

Expand Down Expand Up @@ -78,14 +79,13 @@ export default [
},
plugins: [
...plugins,
((rollupPlugin) => ({
...rollupPlugin,
// Moving to a later lifecycle hook as generateBundle has not written
// the file disk yet. Removing execution from generateBundle hook and
// moved it to the writeBundle hook.
writeBundle: rollupPlugin.generateBundle,
generateBundle: undefined,
}))(execute(`chmod +x dist/${cliConfig.name}`)),
// add execute permission to the executable
{
name: 'writeBundle',
writeBundle: () => {
spawnSync(`chmod`, ['u+x', `dist/${cliConfig.name}`]);
}
},
!process.env.ROLLUP_WATCH ? del({ targets: 'dist/**/*' }) : undefined,
],
},
Expand Down

0 comments on commit 0b68542

Please sign in to comment.