@vitus-labs/tools-rollup 0.22.0 → 0.24.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/tools-rollup",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.com>",
6
6
  "maintainers": [
@@ -16,22 +16,22 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@rollup/plugin-node-resolve": "^13.0.6",
20
- "@rollup/plugin-replace": "^3.0.0",
21
- "@types/node": "^16.11.7",
19
+ "@rollup/plugin-node-resolve": "^13.1.3",
20
+ "@rollup/plugin-replace": "^3.0.1",
21
+ "@types/node": "^17.0.10",
22
22
  "@zerollup/ts-transform-paths": "^1.7.18",
23
23
  "chalk": "^4.1.2",
24
24
  "find-up": "^5.0.0",
25
25
  "lodash.merge": "^4.6.2",
26
26
  "rimraf": "^3.0.2",
27
- "rollup": "^2.60.0",
27
+ "rollup": "^2.66.0",
28
28
  "rollup-plugin-babel": "^4.4.0",
29
- "rollup-plugin-dts": "^3.0.2",
30
- "rollup-plugin-filesize": "^9.1.0",
29
+ "rollup-plugin-dts": "^4.1.0",
30
+ "rollup-plugin-filesize": "^9.1.2",
31
31
  "rollup-plugin-terser": "^7.0.2",
32
- "rollup-plugin-typescript2": "^0.30.0",
33
- "rollup-plugin-visualizer": "^5.5.2",
34
- "ttypescript": "^1.5.12"
32
+ "rollup-plugin-typescript2": "^0.31.1",
33
+ "rollup-plugin-visualizer": "^5.5.4",
34
+ "ttypescript": "^1.5.13"
35
35
  },
36
- "gitHead": "0d2dec1609c9e0c1d7abb0a51e83d2f85b3566af"
36
+ "gitHead": "70da86ff01f63c793820279ef6323bbf6b71b4b2"
37
37
  }
@@ -3,6 +3,7 @@ module.exports = {
3
3
  outputDir: 'lib',
4
4
  typesDir: 'lib/types',
5
5
  typescript: true,
6
+ replaceGlobals: true,
6
7
  visualise: {
7
8
  template: 'network',
8
9
  gzipSize: true,
@@ -60,28 +60,31 @@ const loadPlugins = ({ env, platform, typings, file }) => {
60
60
  tsConfig.tsconfigDefaults.compilerOptions.declarationDir = CONFIG.typesDir
61
61
  }
62
62
 
63
- const replaceOptions = {
64
- __VERSION__: JSON.stringify(PKG.version),
65
- __SERVER__: JSON.stringify(platform === 'server'),
66
- __WEB__: JSON.stringify(
67
- ['server', 'browser', 'universal'].includes(platform)
68
- ),
69
- __BROWSER__: JSON.stringify(platform === 'browser'),
70
- __NATIVE__: JSON.stringify(platform === 'native'),
71
- __CLIENT__: JSON.stringify(['native', 'browser'].includes(platform)),
72
- }
73
-
74
- if (env === 'production') {
75
- replaceOptions['process.env.NODE_ENV'] = JSON.stringify(env)
76
- }
77
-
78
63
  const plugins = [nodeResolve({ extensions, browser: platform === 'browser' })]
79
64
 
80
65
  if (CONFIG.typescript) {
81
66
  plugins.push(typescript(tsConfig))
82
67
  }
83
68
 
84
- plugins.push(replace({ preventAssignment: true, values: replaceOptions }))
69
+ if (CONFIG.replaceGlobals) {
70
+ const replaceOptions = {
71
+ __VERSION__: JSON.stringify(PKG.version),
72
+ __SERVER__: JSON.stringify(platform === 'server'),
73
+ __WEB__: JSON.stringify(
74
+ ['server', 'browser', 'universal'].includes(platform)
75
+ ),
76
+ __BROWSER__: JSON.stringify(platform === 'browser'),
77
+ __NATIVE__: JSON.stringify(platform === 'native'),
78
+ __CLIENT__: JSON.stringify(['native', 'browser'].includes(platform)),
79
+ }
80
+
81
+ if (env === 'production') {
82
+ replaceOptions['process.env.NODE_ENV'] = JSON.stringify(env)
83
+ }
84
+
85
+ plugins.push(replace({ preventAssignment: true, values: replaceOptions }))
86
+ }
87
+
85
88
  plugins.push(babel(babelConfig))
86
89
 
87
90
  // generate visualised graphs in dist folder