Merged master into 1.3.1_branch
This commit is contained in:
11
fixup
Executable file
11
fixup
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
cat <<EOF >dist/cjs/package.json
|
||||||
|
{
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >dist/mjs/package.json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
17
package.json
17
package.json
@@ -23,15 +23,22 @@
|
|||||||
"altcoin",
|
"altcoin",
|
||||||
"cryptocurrency"
|
"cryptocurrency"
|
||||||
],
|
],
|
||||||
"main": "dist/repertory-js.mjs",
|
"main": "dist/cjs/index.js",
|
||||||
"module": "dist/repertory-js.mjs",
|
"module": "dist/mjs/index.js",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/mjs/index.js",
|
||||||
|
"require": "./dist/cjs/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist/cjs",
|
||||||
|
"dist/mjs"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c && ./fixup",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"prepublish": "rollup -c --silent"
|
"prepublish": "rollup -c --silent && ./fixup"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"int64-buffer": "^1.0.0",
|
"int64-buffer": "^1.0.0",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import json from '@rollup/plugin-json';
|
|||||||
const commonConfig = {
|
const commonConfig = {
|
||||||
input: 'src/index.js',
|
input: 'src/index.js',
|
||||||
output: {
|
output: {
|
||||||
name: 'repertory-js',
|
name: 'index',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -28,19 +28,33 @@ const commonConfig = {
|
|||||||
// ESM config
|
// ESM config
|
||||||
const esmConfig = Object.assign({}, commonConfig);
|
const esmConfig = Object.assign({}, commonConfig);
|
||||||
esmConfig.output = Object.assign({}, commonConfig.output, {
|
esmConfig.output = Object.assign({}, commonConfig.output, {
|
||||||
file: 'dist/repertory-js.mjs',
|
file: 'dist/mjs/index.js',
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
});
|
});
|
||||||
|
|
||||||
// ESM prod config
|
// ESM prod config
|
||||||
const esmProdConfig = Object.assign({}, esmConfig);
|
const esmProdConfig = Object.assign({}, esmConfig);
|
||||||
esmProdConfig.output = Object.assign({}, esmConfig.output, {
|
esmProdConfig.output = Object.assign({}, esmConfig.output, {
|
||||||
file: 'dist/repertory-js.min.mjs',
|
file: 'dist/mjs/index.min.js',
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
});
|
});
|
||||||
esmProdConfig.plugins = [...esmConfig.plugins, terser()];
|
esmProdConfig.plugins = [...esmConfig.plugins, terser()];
|
||||||
|
|
||||||
|
// CJS config
|
||||||
|
const cjsConfig = Object.assign({}, commonConfig);
|
||||||
|
cjsConfig.output = Object.assign({}, commonConfig.output, {
|
||||||
|
file: 'dist/cjs/index.js',
|
||||||
|
format: 'cjs',
|
||||||
|
});
|
||||||
|
|
||||||
|
// CJS prod config
|
||||||
|
const cjsProdConfig = Object.assign({}, cjsConfig);
|
||||||
|
cjsProdConfig.output = Object.assign({}, cjsConfig.output, {
|
||||||
|
file: 'dist/cjs/index.min.js',
|
||||||
|
sourcemap: false,
|
||||||
|
});
|
||||||
|
cjsProdConfig.plugins = [...cjsConfig.plugins, terser()];
|
||||||
let configurations = [];
|
let configurations = [];
|
||||||
configurations.push(esmConfig, esmProdConfig);
|
configurations.push(esmConfig, esmProdConfig, cjsConfig, cjsProdConfig);
|
||||||
|
|
||||||
export default configurations;
|
export default configurations;
|
||||||
|
|||||||
Reference in New Issue
Block a user