Skip to content

Commit

Permalink
chore(deps): update dependency rollup to v3 (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Apr 16, 2023
1 parent 7882b1e commit 07f2921
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 150 deletions.
30 changes: 11 additions & 19 deletions config/rollup.build.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import fs from "fs"
import path from "path"
import babel from "@rollup/plugin-babel"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import { terser } from "rollup-plugin-terser"
import terser from "@rollup/plugin-terser"

const currentDir = process.cwd()
const loadJSON = (path) =>
JSON.parse(fs.readFileSync(new URL(path, import.meta.url)))

const dirname = path.resolve()
const year = new Date().getFullYear()

const banner = async () => {
const { default: pkg } = await import("../package.json")
const pkg = loadJSON("../package.json")

return `/*!
* @license MIT (https://github.com/geotrev/${pkg.name}/blob/master/LICENSE)
Expand All @@ -23,7 +27,7 @@ const baseOutput = {
}

export default {
input: path.resolve(currentDir, "src/index.js"),
input: path.resolve(dirname, "src/index.js"),
plugins: [
nodeResolve(),
babel({
Expand All @@ -35,24 +39,12 @@ export default {
output: [
{
...baseOutput,
file: path.resolve(currentDir, "lib/snabbdom-transform-jsx-props.js"),
file: path.resolve(dirname, "lib/snabbdom-transform-jsx-props.js"),
},
{
...baseOutput,
file: path.resolve(currentDir, "lib/snabbdom-transform-jsx-props.min.js"),
plugins: [
terser({
output: {
comments: (_, comment) => {
const { value, type } = comment

if (type === "comment2") {
return /@preserve|@license|@cc_on/i.test(value)
}
},
},
}),
],
file: path.resolve(dirname, "lib/snabbdom-transform-jsx-props.min.js"),
plugins: [terser()],
},
],
}
216 changes: 87 additions & 129 deletions package-lock.json

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

Loading

0 comments on commit 07f2921

Please sign in to comment.