config/rollup.build.config.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 47
Function Count 1

Duplication

Duplicated Lines 47
Ratio 100 %

Importance

Changes 0
Metric Value
wmc 1
eloc 34
mnd 0
bc 0
fnc 1
dl 47
loc 47
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1 View Code Duplication
import typescript from "rollup-plugin-typescript2";
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2
import del from "rollup-plugin-delete";
3
import { terser } from "rollup-plugin-terser";
4
import banner2 from "rollup-plugin-banner2";
5
6
import pkg from "../package.json";
7
8
export default [
9
  {
10
    input: "src/index.ts",
11
    output: [
12
      {
13
        dir: "playground/src/modular-preview",
14
        format: "cjs",
15
        plugins: [terser()],
16
        strict: false,
17
      },
18
      {
19
        dir: "playground/src/modular-preview",
20
        format: "esm",
21
       // plugins: [terser()],
22
        strict: false,
23
      },
24
      {
25
        dir: pkg.module,
26
        format: "cjs",
27
        strict: false,
28
        plugins: [terser()],
29
      },
30
      {
31
        dir: pkg.module,
32
        format: "esm",
33
       // plugins: [terser()],
34
        strict: false,
35
      },
36
    ],
37
    plugins: [
38
      del({ targets: ["dist/*", "playground/src/modular-preview"] }),
39
      banner2(() => `/* eslint-disable */`),
40
      typescript({
41
        rollupCommonJSResolveHack: false,
42
        clean: true,
43
      }),
44
    ],
45
    external: Object.keys(pkg.peerDependencies || {}),
46
  },
47
];
48