@repodog/rollup-config 4.0.6 → 4.0.8
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 +3 -3
- package/{index.cjs → index.mjs} +20 -14
- 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,7 +28,7 @@ npm install @repodog/rollup-config rollup --save-dev
|
|
|
28
28
|
### With Babel
|
|
29
29
|
|
|
30
30
|
```javascript
|
|
31
|
-
// rollup.config.
|
|
31
|
+
// rollup.config.mjs
|
|
32
32
|
const rollupConfig = require('@repodog/rollup-config');
|
|
33
33
|
const babelConfig = require('@repodog/babel-config/rollup');
|
|
34
34
|
const { babel: babelPlugin } = require('@rollup/plugin-babel');
|
|
@@ -41,7 +41,7 @@ module.exports = {
|
|
|
41
41
|
### With SWC
|
|
42
42
|
|
|
43
43
|
```javascript
|
|
44
|
-
// rollup.config.
|
|
44
|
+
// rollup.config.mjs
|
|
45
45
|
const rollupConfig = require('@repodog/rollup-config');
|
|
46
46
|
const swcConfig = require('@repodog/swc-config');
|
|
47
47
|
const swcPlugin = require('@rollup/plugin-swc');
|
package/{index.cjs → index.mjs}
RENAMED
|
@@ -1,18 +1,21 @@
|
|
|
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';
|
|
14
17
|
const packageDir = process.cwd();
|
|
15
|
-
const external = id => !id.startsWith('.') && !id.startsWith('
|
|
18
|
+
const external = id => !id.startsWith('.') && !id.startsWith('#') && !isAbsolute(id);
|
|
16
19
|
const outputExtension = MODULE_SYSTEM === 'esm' ? 'mjs' : 'cjs';
|
|
17
20
|
|
|
18
21
|
const sourcemapPathTransform = sourcePath => {
|
|
@@ -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
|
];
|
|
@@ -66,9 +70,9 @@ const config = (options = {}) => {
|
|
|
66
70
|
|
|
67
71
|
return {
|
|
68
72
|
external,
|
|
69
|
-
input:
|
|
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.8",
|
|
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
|
}
|