@vyr/pack-rollup-config-plugin 0.0.4 → 0.0.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.
@@ -0,0 +1,3 @@
1
+ declare const getRollupConfigContent: (outputFile: string, input: string, outputPath: string, external: string[]) => string;
2
+ declare const createRollupConfigFactory: (config: string) => Function;
3
+ export { getRollupConfigContent, createRollupConfigFactory, };
@@ -1,47 +1,34 @@
1
- const fs = require('fs-extra')
2
-
3
- const getRollupConfigContent = (outputFile: string, input: string, outputPath: string, external: string[]) => {
4
- const configObj = {
5
- }
6
-
7
- const config = [
8
- `{`,
9
- ` input: ${JSON.stringify(input)},`,
10
- ` output: {`,
11
- ` file: ${JSON.stringify(outputPath)},`,
12
- ` format: 'cjs',`,
13
- ` inlineDynamicImports: true,`,
14
- ` },`,
15
- ` external: ${JSON.stringify(external)},`,
16
- ` plugins: [`,
17
- ` nodeResolve({ preferBuiltins: true}),`,
18
- ` commonjs({ ignoreDynamicRequires: true }),`,
19
- ` esbuild(${JSON.stringify(configObj)}),`,
20
- ` varRename(${JSON.stringify(external)}, ${JSON.stringify(outputFile)}),`,
21
- ` json(),`,
22
- ` postcss({ extract: false, minimize: true })`,
23
- ` ],`,
24
- ` treeshake: false,`,
25
- `}`,
26
- ].join('\n')
27
-
28
- return config
29
- }
30
-
31
- const createRollupConfigFactory = (config: string) => {
32
- const factory = new Function(
33
- 'nodeResolve',
34
- 'commonjs',
35
- 'json',
36
- 'postcss',
37
- 'esbuild',
38
- 'varRename',
39
- `return ${config}`)
40
-
41
- return factory
42
- }
43
-
44
- export {
45
- getRollupConfigContent,
46
- createRollupConfigFactory,
47
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRollupConfigFactory = exports.getRollupConfigContent = void 0;
4
+ const fs = require('fs-extra');
5
+ const getRollupConfigContent = (outputFile, input, outputPath, external) => {
6
+ const configObj = {};
7
+ const config = [
8
+ `{`,
9
+ ` input: ${JSON.stringify(input)},`,
10
+ ` output: {`,
11
+ ` file: ${JSON.stringify(outputPath)},`,
12
+ ` format: 'cjs',`,
13
+ ` inlineDynamicImports: true,`,
14
+ ` },`,
15
+ ` external: ${JSON.stringify(external)},`,
16
+ ` plugins: [`,
17
+ ` nodeResolve({ preferBuiltins: true}),`,
18
+ ` commonjs({ ignoreDynamicRequires: true }),`,
19
+ ` esbuild(${JSON.stringify(configObj)}),`,
20
+ ` varRename(${JSON.stringify(external)}, ${JSON.stringify(outputFile)}),`,
21
+ ` json(),`,
22
+ ` postcss({ extract: false, minimize: true })`,
23
+ ` ],`,
24
+ ` treeshake: false,`,
25
+ `}`,
26
+ ].join('\n');
27
+ return config;
28
+ };
29
+ exports.getRollupConfigContent = getRollupConfigContent;
30
+ const createRollupConfigFactory = (config) => {
31
+ const factory = new Function('nodeResolve', 'commonjs', 'json', 'postcss', 'esbuild', 'varRename', `return ${config}`);
32
+ return factory;
33
+ };
34
+ exports.createRollupConfigFactory = createRollupConfigFactory;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@vyr/pack-rollup-config-plugin","version":"0.0.4","description":"","main":"./build/index.js","author":"","license":"ISC"}
1
+ {"name":"@vyr/pack-rollup-config-plugin","version":"0.0.6","description":"","main":"./build/index.js","author":"","files":["build/","package.json"],"license":"ISC"}
package/tsconfig.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "CommonJS",
5
- "moduleResolution": "node",
6
- "lib": [
7
- "ESNext",
8
- "DOM",
9
- "DOM.Iterable"
10
- ],
11
- "outDir": "build",
12
- "strict": true,
13
- "jsx": "preserve",
14
- "declaration": true,
15
- "skipLibCheck": true,
16
- "esModuleInterop": true,
17
- "allowSyntheticDefaultImports": true,
18
- "forceConsistentCasingInFileNames": true,
19
- "useDefineForClassFields": true,
20
- "sourceMap": false,
21
- "baseUrl": "",
22
- "types": [
23
- "webpack-env"
24
- ],
25
- "paths": {}
26
- },
27
- "include": [
28
- "src/**/*.ts",
29
- ],
30
- "exclude": []
31
- }