@vyr/pack-rollup-config-plugin 0.0.4 → 0.0.5
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/build/index.d.ts +3 -0
- package/{src/index.ts → build/index.js} +34 -47
- package/package.json +12 -1
- package/tsconfig.json +0 -31
package/build/index.d.ts
ADDED
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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,12 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@vyr/pack-rollup-config-plugin",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./build/index.js",
|
|
6
|
+
"author": "",
|
|
7
|
+
"files": [
|
|
8
|
+
"build/",
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"license": "ISC"
|
|
12
|
+
}
|
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
|
-
}
|