Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Commit

Permalink
Delete old files from dist on build
Browse files Browse the repository at this point in the history
Rebuilding locally keeps accumulating rollup modules,
making local builds difficult to deploy.
  • Loading branch information
jvarho committed May 1, 2021
1 parent 31f3d34 commit a6cd0b3
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/libs/lambda-at-edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@types/sharp": "^0.26.1",
"fetch-mock-jest": "^1.5.1",
"rollup": "^2.46.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-node-externals": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/libs/lambda-at-edge/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { nodeResolve } from "@rollup/plugin-node-resolve";
import externals from "rollup-plugin-node-externals";
import json from "@rollup/plugin-json";
import { terser } from "rollup-plugin-terser";
import del from "rollup-plugin-delete";

const LOCAL_EXTERNALS = [
"./manifest.json",
Expand All @@ -21,6 +22,10 @@ const generateConfig = (input) => ({
format: "cjs"
},
plugins: [
del({
targets:
'./dist/${input.filename}/${input.minify ? "minified" : "standard"}'
}),
json(),
commonjs(),
externals({
Expand Down
Loading

0 comments on commit a6cd0b3

Please sign in to comment.