Skip to content

Commit 1b33551

Browse files
committed
chore(deps): bump dependencies
1 parent 70fabc8 commit 1b33551

File tree

5 files changed

+2758
-2164
lines changed

5 files changed

+2758
-2164
lines changed

.browserslistrc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
edge >= 81
2-
firefox >= 54
3-
chrome >= 51
4-
safari >= 12
5-
ios >= 11
6-
not ie <= 11
1+
>0.2%, not dead

config/rollup.build.config.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
import fs from "fs"
12
import path from "path"
23
import babel from "@rollup/plugin-babel"
34
import { nodeResolve } from "@rollup/plugin-node-resolve"
4-
import { terser } from "rollup-plugin-terser"
5+
import terser from "@rollup/plugin-terser"
56

6-
const currentDir = process.cwd()
7+
const loadJSON = (path) =>
8+
JSON.parse(fs.readFileSync(new URL(path, import.meta.url)))
9+
10+
const dirname = path.resolve()
711
const year = new Date().getFullYear()
812

913
const banner = async () => {
10-
const { default: pkg } = await import("../package.json")
14+
const pkg = loadJSON("../package.json")
1115

1216
return `/*!
1317
* @license MIT (https://github.com/geotrev/omdomdom/blob/master/LICENSE)
@@ -21,7 +25,7 @@ const Formats = {
2125
ES: "es",
2226
UMD: "umd",
2327
}
24-
const input = path.resolve(currentDir, "src/index.js")
28+
const input = path.resolve(dirname, "src/index.js")
2529
const basePlugins = [
2630
nodeResolve(),
2731
babel({
@@ -31,17 +35,7 @@ const basePlugins = [
3135
}),
3236
]
3337

34-
const terserPlugin = terser({
35-
output: {
36-
comments: (_, comment) => {
37-
const { value, type } = comment
38-
39-
if (type === "comment2") {
40-
return /@preserve|@license|@cc_on/i.test(value)
41-
}
42-
},
43-
},
44-
})
38+
const terserPlugin = terser()
4539

4640
const baseOutput = (format) => ({
4741
banner,
@@ -55,22 +49,22 @@ const outputs = [Formats.ES, Formats.CJS].reduce(
5549
...configs,
5650
{
5751
...baseOutput(format),
58-
file: path.resolve(currentDir, `lib/omdomdom.${format}.js`),
52+
file: path.resolve(dirname, `lib/omdomdom.${format}.js`),
5953
},
6054
{
6155
...baseOutput(format),
62-
file: path.resolve(currentDir, `lib/omdomdom.${format}.min.js`),
56+
file: path.resolve(dirname, `lib/omdomdom.${format}.min.js`),
6357
plugins: [terserPlugin],
6458
},
6559
],
6660
[
6761
{
6862
...baseOutput(Formats.UMD),
69-
file: path.resolve(currentDir, "dist/omdomdom.js"),
63+
file: path.resolve(dirname, "dist/omdomdom.js"),
7064
},
7165
{
7266
...baseOutput(Formats.UMD),
73-
file: path.resolve(currentDir, "dist/omdomdom.min.js"),
67+
file: path.resolve(dirname, "dist/omdomdom.min.js"),
7468
plugins: [terserPlugin],
7569
},
7670
]

config/rollup.serve.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import livereload from "rollup-plugin-livereload"
55

66
const { CDN } = process.env
77
const isCdnMode = CDN === "true"
8-
const currentDir = process.cwd()
9-
const TEST_ROOT = path.resolve(currentDir, "test")
8+
const dirname = path.resolve()
9+
const TEST_ROOT = path.resolve(dirname, "test")
1010
const SOURCE_PATH = TEST_ROOT + "/test-cases.js"
1111
const OUTPUT_PATH = TEST_ROOT + "/bundle.js"
12-
const OMDOMDOM_EXTERNAL_ID = path.resolve(currentDir, "src/index.js")
12+
const OMDOMDOM_EXTERNAL_ID = path.resolve(dirname, "src/index.js")
1313

1414
export default {
1515
input: SOURCE_PATH,

0 commit comments

Comments
 (0)