@repodog/rollup-config 1.1.5 → 1.1.6

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.
Files changed (2) hide show
  1. package/index.cjs +10 -10
  2. package/package.json +1 -1
package/index.cjs CHANGED
@@ -11,8 +11,8 @@ const copy = require('rollup-plugin-copy');
11
11
  const sourcemaps = require('rollup-plugin-sourcemaps');
12
12
 
13
13
  const { NODE_ENV } = process.env;
14
- const isProductionEnvironment = NODE_ENV === 'production' || NODE_ENV === 'prod';
15
- const packageDirectory = process.cwd();
14
+ const isProdEnv = NODE_ENV === 'production' || NODE_ENV === 'prod';
15
+ const packageDir = process.cwd();
16
16
  const external = id => !id.startsWith('.') && !id.startsWith('/');
17
17
 
18
18
  const sourcemapPathTransform = sourcePath => {
@@ -20,7 +20,7 @@ const sourcemapPathTransform = sourcePath => {
20
20
  return sourcePath;
21
21
  }
22
22
 
23
- return sourcePath.replace('../../src', `../${basename(packageDirectory)}/src/`);
23
+ return sourcePath.replace('../../src', `../${basename(packageDir)}/src/`);
24
24
  };
25
25
 
26
26
  module.exports = (config = {}) => {
@@ -44,35 +44,35 @@ module.exports = (config = {}) => {
44
44
  plugins.push(copy(config.copy));
45
45
  }
46
46
 
47
- if (isProductionEnvironment) {
47
+ if (isProdEnv) {
48
48
  plugins.push(
49
49
  terser(),
50
50
  analyzer({
51
51
  writeTo: analysis => {
52
- if (!existsSync(`${packageDirectory}/dist`)) {
53
- mkdirSync(`${packageDirectory}/dist`);
52
+ if (!existsSync(`${packageDir}/dist`)) {
53
+ mkdirSync(`${packageDir}/dist`);
54
54
  }
55
55
 
56
- writeFileSync(`${packageDirectory}/dist/production.analysis.txt`, analysis);
56
+ writeFileSync(`${packageDir}/dist/production.analysis.txt`, analysis);
57
57
  },
58
58
  })
59
59
  );
60
60
  }
61
61
 
62
- if (!isProductionEnvironment) {
62
+ if (!isProdEnv) {
63
63
  plugins.push(sourcemaps());
64
64
  }
65
65
 
66
66
  return {
67
67
  external,
68
- input: `${packageDirectory}/src/index`,
68
+ input: `${packageDir}/src/index`,
69
69
  onwarn: ({ code, message }) => {
70
70
  if (code !== 'THIS_IS_UNDEFIEND') {
71
71
  console.error(message); // eslint-disable-line no-console
72
72
  }
73
73
  },
74
74
  output: {
75
- file: `${packageDirectory}/dist/main/index.mjs`,
75
+ file: `${packageDir}/dist/main/index.mjs`,
76
76
  format: 'esm',
77
77
  sourcemap: true,
78
78
  sourcemapPathTransform,
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": "1.1.5",
4
+ "version": "1.1.6",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/repodog",