@repodog/rollup-config 4.0.7 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/{index.cjs → index.mjs} +18 -12
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install @repodog/rollup-config rollup --save-dev
|
|
|
20
20
|
// package.json
|
|
21
21
|
{
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "rollup -c ./rollup.config.
|
|
23
|
+
"build": "rollup -c ./rollup.config.mjs"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
```
|
|
@@ -28,12 +28,12 @@ npm install @repodog/rollup-config rollup --save-dev
|
|
|
28
28
|
### With Babel
|
|
29
29
|
|
|
30
30
|
```javascript
|
|
31
|
-
// rollup.config.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
// rollup.config.mjs
|
|
32
|
+
import rollupConfig from '@repodog/rollup-config';
|
|
33
|
+
import babelConfig from '@repodog/babel-config/rollup';
|
|
34
|
+
import { babel as babelPlugin } from '@rollup/plugin-babel';
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
export default {
|
|
37
37
|
...rollupConfig({ compiler: babelPlugin(babelConfig) }),
|
|
38
38
|
};
|
|
39
39
|
```
|
|
@@ -41,12 +41,12 @@ module.exports = {
|
|
|
41
41
|
### With SWC
|
|
42
42
|
|
|
43
43
|
```javascript
|
|
44
|
-
// rollup.config.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// rollup.config.mjs
|
|
45
|
+
import rollupConfig from '@repodog/rollup-config';
|
|
46
|
+
import swcConfig from '@repodog/swc-config';
|
|
47
|
+
import swcPlugin from '@rollup/plugin-swc';
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
export default {
|
|
50
50
|
...rollupConfig({ compiler: swcPlugin({ swc: swcConfig.ts }) }),
|
|
51
51
|
// or
|
|
52
52
|
...rollupConfig({ compiler: swcPlugin({ swc: swcConfig.js }) }),
|
|
@@ -63,4 +63,4 @@ Sets `output.format`, directory name within `./dist` output, and the extension o
|
|
|
63
63
|
|
|
64
64
|
When set to `'production'`, terser mangles and compresses, the bundle analyser runs, and source maps are omitted.
|
|
65
65
|
|
|
66
|
-
**You
|
|
66
|
+
**You can also use the environment variables outlined in [`@repodog/babel-config`](../babel-config/README.md#environment-variables) or [`@repodog/swc-config`](../swc-config/README.md#environment-variables) to control what is output.**
|
package/{index.cjs → index.mjs}
RENAMED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
+
import image from '@rollup/plugin-image';
|
|
3
|
+
import json from '@rollup/plugin-json';
|
|
4
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
5
|
+
import terser from '@rollup/plugin-terser';
|
|
6
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { basename, isAbsolute, resolve } from 'node:path';
|
|
8
|
+
import analyzer from 'rollup-plugin-analyzer';
|
|
9
|
+
import copy from 'rollup-plugin-copy';
|
|
10
|
+
import sourcemaps from 'rollup-plugin-sourcemaps';
|
|
11
|
+
// false positive
|
|
12
|
+
// eslint-disable-next-line import-x/no-unresolved
|
|
13
|
+
import macros from 'unplugin-macros/rollup';
|
|
11
14
|
|
|
12
15
|
const { MODULE_SYSTEM = 'esm', NODE_ENV } = process.env;
|
|
13
16
|
const isProdEnv = NODE_ENV === 'production';
|
|
@@ -37,6 +40,7 @@ const config = (options = {}) => {
|
|
|
37
40
|
extensions,
|
|
38
41
|
}),
|
|
39
42
|
commonjs(),
|
|
43
|
+
macros(),
|
|
40
44
|
options.compiler,
|
|
41
45
|
image(),
|
|
42
46
|
];
|
|
@@ -68,7 +72,7 @@ const config = (options = {}) => {
|
|
|
68
72
|
external,
|
|
69
73
|
input: resolve(packageDir, 'src', 'index'),
|
|
70
74
|
onwarn: ({ code, message }) => {
|
|
71
|
-
if (code !== '
|
|
75
|
+
if (code !== 'THIS_IS_UNDEFINED') {
|
|
72
76
|
console.error(message);
|
|
73
77
|
}
|
|
74
78
|
},
|
|
@@ -82,4 +86,6 @@ const config = (options = {}) => {
|
|
|
82
86
|
};
|
|
83
87
|
};
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
// rollup requires config to be default export
|
|
90
|
+
// eslint-disable-next-line import-x/no-default-export
|
|
91
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repodog/rollup-config",
|
|
3
3
|
"description": "The Repodog Rollup config module.",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.9",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/repodog",
|
|
@@ -11,24 +11,26 @@
|
|
|
11
11
|
"url": "https://github.com/badbatch/repodog/configs/rollup-config"
|
|
12
12
|
},
|
|
13
13
|
"bugs": "https://github.com/badbatch/repodog/issues",
|
|
14
|
-
"
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "index.mjs",
|
|
15
16
|
"publishConfig": {
|
|
16
17
|
"access": "public"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@rollup/plugin-commonjs": "^
|
|
20
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
20
21
|
"@rollup/plugin-image": "^3.0.3",
|
|
21
22
|
"@rollup/plugin-json": "^6.1.0",
|
|
22
|
-
"@rollup/plugin-node-resolve": "^
|
|
23
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
23
24
|
"@rollup/plugin-terser": "^0.4.4",
|
|
24
25
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
25
26
|
"rollup-plugin-copy": "^3.5.0",
|
|
26
|
-
"rollup-plugin-sourcemaps": "^0.6.3"
|
|
27
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
28
|
+
"unplugin-macros": "^0.17.0"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
31
|
"rollup": "<5"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
|
-
"rollup": "^4.
|
|
34
|
+
"rollup": "^4.41.0"
|
|
33
35
|
}
|
|
34
36
|
}
|