mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-07 16:23:09 +00:00
Setup rollup, move files to dist/
This commit is contained in:
parent
82aba32f9e
commit
c4758a8737
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
.nyc_output
|
.nyc_output
|
||||||
.angular
|
.angular
|
||||||
build
|
build
|
||||||
|
dist
|
||||||
node_modules
|
node_modules
|
||||||
src/**.js
|
src/**.js
|
||||||
coverage
|
coverage
|
||||||
|
|||||||
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Published files moved from `build` to `dist/`.
|
||||||
|
|
||||||
## [0.24.0] - 2022-05-27
|
## [0.24.0] - 2022-05-27
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
781
package-lock.json
generated
781
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -2,10 +2,10 @@
|
|||||||
"name": "js-waku",
|
"name": "js-waku",
|
||||||
"version": "0.24.0",
|
"version": "0.24.0",
|
||||||
"description": "TypeScript implementation of the Waku v2 protocol",
|
"description": "TypeScript implementation of the Waku v2 protocol",
|
||||||
"types": "./build/esm/index.d.ts",
|
"types": "./dist/esm/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"node": {
|
"node": {
|
||||||
"import": "./build/esm/index.js"
|
"import": "./dist/esm/index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -21,12 +21,10 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"build": "rimraf ./build; run-p build:**",
|
"build": "rimraf ./dist; run-s build:**",
|
||||||
"build:esm": "tsc",
|
"build:esm": "tsc",
|
||||||
"build:umd": "webpack --config webpack.config.cjs",
|
"build:umd": "rollup --config rollup.config.js -- dist/esm/index.js",
|
||||||
"build:umd:min": "webpack --config webpack.config.min.cjs",
|
"build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz",
|
||||||
"build:umd:bundle": "webpack --config webpack.config.bundle.cjs",
|
|
||||||
"build:umd:min:bundle": "webpack --config webpack.config.min.bundle.cjs",
|
|
||||||
"size": "npm run build:esm && size-limit",
|
"size": "npm run build:esm && size-limit",
|
||||||
"fix": "run-s fix:*",
|
"fix": "run-s fix:*",
|
||||||
"fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write",
|
"fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write",
|
||||||
@ -90,6 +88,9 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
||||||
|
"@rollup/plugin-commonjs": "^22.0.0",
|
||||||
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||||
"@size-limit/preset-big-lib": "^7.0.8",
|
"@size-limit/preset-big-lib": "^7.0.8",
|
||||||
"@types/app-root-path": "^1.2.4",
|
"@types/app-root-path": "^1.2.4",
|
||||||
"@types/chai": "^4.2.15",
|
"@types/chai": "^4.2.15",
|
||||||
@ -132,20 +133,21 @@
|
|||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"protons": "^3.0.4",
|
"protons": "^3.0.4",
|
||||||
"puppeteer": "^13.0.1",
|
"puppeteer": "^13.0.1",
|
||||||
|
"rollup": "^2.75.0",
|
||||||
|
"rollup-plugin-polyfill-node": "^0.9.0",
|
||||||
"size-limit": "^7.0.8",
|
"size-limit": "^7.0.8",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"tail": "^2.2.0",
|
"tail": "^2.2.0",
|
||||||
|
"terser": "^5.13.1",
|
||||||
"ts-loader": "^9.2.6",
|
"ts-loader": "^9.2.6",
|
||||||
"ts-node": "^10.4.0",
|
"ts-node": "^10.4.0",
|
||||||
"typedoc": "^0.22.10",
|
"typedoc": "^0.22.10",
|
||||||
"typedoc-plugin-no-inherit": "^1.3.1",
|
"typedoc-plugin-no-inherit": "^1.3.1",
|
||||||
"typescript": "^4.5.5",
|
"typescript": "^4.5.5"
|
||||||
"webpack": "^5.58.1",
|
|
||||||
"webpack-cli": "^4.9.0"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"build/esm",
|
"dist/esm",
|
||||||
"build/umd",
|
"dist/umd",
|
||||||
"src/lib/**/*.ts",
|
"src/lib/**/*.ts",
|
||||||
"src/proto/**/*.ts",
|
"src/proto/**/*.ts",
|
||||||
"!**/*.spec.*",
|
"!**/*.spec.*",
|
||||||
@ -162,7 +164,7 @@
|
|||||||
},
|
},
|
||||||
"size-limit": [
|
"size-limit": [
|
||||||
{
|
{
|
||||||
"path": "build/esm/index.js",
|
"path": "dist/esm/index.js",
|
||||||
"import": "{ Waku }",
|
"import": "{ Waku }",
|
||||||
"config": "./webpack.config.cjs"
|
"config": "./webpack.config.cjs"
|
||||||
}
|
}
|
||||||
|
|||||||
21
rollup.config.js
Normal file
21
rollup.config.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
|
import commonjs from "@rollup/plugin-commonjs";
|
||||||
|
import json from "@rollup/plugin-json";
|
||||||
|
import nodePolyfills from "rollup-plugin-polyfill-node";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
output: {
|
||||||
|
file: "dist/umd/index.js",
|
||||||
|
format: "umd",
|
||||||
|
name: "jswaku",
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
commonjs(),
|
||||||
|
json(),
|
||||||
|
nodePolyfills(),
|
||||||
|
nodeResolve({
|
||||||
|
browser: true,
|
||||||
|
preferBuiltins: false,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
};
|
||||||
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"target": "es2015",
|
"target": "es2020",
|
||||||
"outDir": "build/esm",
|
"outDir": "dist/esm",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"module": "es2020",
|
"module": "es2020",
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig",
|
|
||||||
"compilerOptions": {
|
|
||||||
"module": "UMD",
|
|
||||||
"target": "es6",
|
|
||||||
"removeComments": true,
|
|
||||||
"outFile": "build/min.js"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -10,7 +10,7 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.(js|tsx?)$/,
|
||||||
use: "ts-loader",
|
use: "ts-loader",
|
||||||
exclude: /(node_modules)|(node\.spec\.ts)/,
|
exclude: /(node_modules)|(node\.spec\.ts)/,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user