Rollup changes
This commit is contained in:
4
.babelrc
4
.babelrc
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"],
|
||||
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/transform-runtime"]
|
||||
}
|
||||
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
.vscode
|
||||
dist
|
||||
backup
|
||||
17
.eslintrc
Normal file
17
.eslintrc
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jquery": true,
|
||||
"jest/globals": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"allowImportExportEverywhere": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parser": "babel-eslint"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"jest/globals": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": {
|
||||
"jest"
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
}
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
package-lock.json
|
||||
.idea/
|
||||
node_modules/
|
||||
coverage/
|
||||
.vscode/
|
||||
dist/
|
||||
backup/
|
||||
.idea/
|
||||
|
||||
4
.npmignore
Normal file
4
.npmignore
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
.vscode
|
||||
dist
|
||||
backup
|
||||
@@ -5,3 +5,4 @@
|
||||
"singleQuote": true,
|
||||
"jsxBracketSameLine": true
|
||||
}
|
||||
|
||||
|
||||
15
babel.config.js
Normal file
15
babel.config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = function (api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: [
|
||||
'@babel/preset-env'
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-proposal-private-methods',
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-transform-regenerator',
|
||||
'@babel/plugin-transform-async-to-generator'
|
||||
]
|
||||
};
|
||||
};
|
||||
72
package.json
72
package.json
@@ -1,10 +1,13 @@
|
||||
{
|
||||
"name": "@scottg1/repertory-js",
|
||||
"name": "@blockstorage/repertory-js",
|
||||
"version": "1.3.1-r1",
|
||||
"description": "A Node.js module for interfacing with Repertory's remote mount API",
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"coverage": "jest --collect-coverage"
|
||||
"author": "scott.e.graves@protonmail.com",
|
||||
"license": "MIT",
|
||||
"homepage": "https://bitbucket.org/blockstorage/repertory-js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://bitbucket.org/blockstorage/repertory-js.git"
|
||||
},
|
||||
"keywords": [
|
||||
"repertory",
|
||||
@@ -20,11 +23,16 @@
|
||||
"altcoin",
|
||||
"cryptocurrency"
|
||||
],
|
||||
"author": "scott.e.graves@protonmail.com",
|
||||
"homepage": "https://bitbucket.org/blockstorage/repertory-js",
|
||||
"license": "MIT",
|
||||
"module": "dist/mjs/repertory-js.mjs",
|
||||
"files": [
|
||||
"dist/mjs"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test": "jest",
|
||||
"prepublish": "rollup -c --silent"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.9",
|
||||
"int64-buffer": "^1.0.0",
|
||||
"js-sha256": "^0.9.0",
|
||||
"socket-pool": "^1.2.3",
|
||||
@@ -32,35 +40,23 @@
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-transform-runtime": "^7.13.9",
|
||||
"@babel/preset-env": "^7.13.9",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"eslint": "^7.22.0",
|
||||
"eslint-plugin-jest": "^24.3.2",
|
||||
"jest": "^26.6.3"
|
||||
},
|
||||
"type": "module",
|
||||
"jest": {
|
||||
"roots": [
|
||||
"src"
|
||||
],
|
||||
"modulePaths": [
|
||||
"src"
|
||||
],
|
||||
"moduleDirectories": [
|
||||
"node_modules"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/__tests__/**/*.[jt]s?(x)",
|
||||
"**/?(*.)+(spec|test).[jt]s?(x)"
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.js?$": "babel-jest"
|
||||
}
|
||||
},
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://bitbucket.org/blockstorage/repertory-js.git"
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
||||
"@babel/plugin-proposal-private-methods": "^7.13.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.13.0",
|
||||
"@babel/plugin-transform-regenerator": "^7.13.15",
|
||||
"@babel/plugin-transform-runtime": "^7.14.3",
|
||||
"@babel/preset-env": "^7.14.2",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^15.1.0",
|
||||
"@rollup/plugin-json": "^4.0.0",
|
||||
"@rollup/plugin-node-resolve": "^9.0.0",
|
||||
"@types/jest": "^26.0.23",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"jest": "^26.6.3",
|
||||
"rollup": "^2.50.0",
|
||||
"rollup-plugin-eslint": "^7.0.0",
|
||||
"rollup-plugin-node-polyfills": "^0.2.1",
|
||||
"rollup-plugin-terser": "^7.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
52
rollup.config.js
Normal file
52
rollup.config.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import babel from "@rollup/plugin-babel";
|
||||
import { terser } from "rollup-plugin-terser";
|
||||
import json from '@rollup/plugin-json';
|
||||
|
||||
const commonConfig = {
|
||||
input: 'src/index.js',
|
||||
output: {
|
||||
name: 'repertory-js',
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [
|
||||
resolve({
|
||||
customResolveOptions: {
|
||||
moduleDirectory: 'node_modules'
|
||||
}
|
||||
}),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
babelHelpers: 'runtime'
|
||||
}),
|
||||
commonjs(),
|
||||
json()
|
||||
]
|
||||
};
|
||||
|
||||
// ESM config
|
||||
const esmConfig = Object.assign({}, commonConfig);
|
||||
esmConfig.output = Object.assign({}, commonConfig.output, {
|
||||
file: 'dist/mjs/repertory-js.mjs',
|
||||
format: 'esm'
|
||||
});
|
||||
|
||||
// ESM prod config
|
||||
const esmProdConfig = Object.assign({}, esmConfig);
|
||||
esmProdConfig.output = Object.assign({}, esmConfig.output, {
|
||||
file: 'dist/mjs/repertory-js.min.mjs',
|
||||
sourcemap: false
|
||||
});
|
||||
esmProdConfig.plugins = [
|
||||
...esmConfig.plugins,
|
||||
terser()
|
||||
];
|
||||
|
||||
let configurations = [];
|
||||
configurations.push(
|
||||
esmConfig,
|
||||
esmProdConfig
|
||||
)
|
||||
|
||||
export default configurations;
|
||||
Reference in New Issue
Block a user