Skip to content

Commit

Permalink
v0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Le Cam committed Jan 16, 2020
1 parent e7c3279 commit 39dedf6
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 102 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ npm install -g @erebos/cli
| [`@erebos/bzz-fs`](/packages/bzz-fs) | [![npm version](https://img.shields.io/npm/v/@erebos/bzz-fs.svg)](https://www.npmjs.com/package/@erebos/bzz-fs) | ⚛️ ⚙️ | File system interactions
| **Data structures**
| [`@erebos/feed-list`](/packages/feed-list) | [![npm version](https://img.shields.io/npm/v/@erebos/feed-list.svg)](https://www.npmjs.com/package/@erebos/feed-list) | ⚛️ ⚙️ 📱 🌐 | List APIs using raw Swarm feeds
| [`@erebos/doc-sync`](/packages/doc-sync) | [![npm version](https://img.shields.io/npm/v/@erebos/doc-sync.svg)](https://www.npmjs.com/package/@erebos/doc-sync) | ⚛️ ⚙️ 📱 🌐 | JSON documents synchronization using CRDTs
| [`@erebos/timeline`](/packages/timeline) | [![npm version](https://img.shields.io/npm/v/@erebos/timeline.svg)](https://www.npmjs.com/package/@erebos/timeline) | ⚛️ ⚙️ 📱 🌐 | Feed-based Timeline APIs
| **Ethereum and Swarm utilities**
| [`@erebos/hex`](/packages/hex) | [![npm version](https://img.shields.io/npm/v/@erebos/hex.svg)](https://www.npmjs.com/package/@erebos/hex) | ⚛️ ⚙️ 📱 🌐 | Hexadecimal values encoding and decoding
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@erebos/cli",
"version": "0.12.0",
"version": "0.13.0",
"description": "Command-line interface for Swarm",
"repository": "git@github.com:MainframeHQ/erebos.git",
"main": "lib/index.js",
Expand Down
174 changes: 73 additions & 101 deletions packages/swarm-browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,109 +4,81 @@
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')
const isProduction = process.env.NODE_ENV === 'production'
const envName = isProduction ? 'production' : 'development'

const main = () => {
const envName = isProduction ? 'production' : 'development'
return {
bail: isProduction,
mode: envName,
devtool: isProduction ? 'source-map' : 'cheap-module-source-map',
entry: [path.join(__dirname, `src`, 'index.ts')],
output: {
path: path.join(__dirname, `dist/`),
filename: `erebos.swarm.${envName}.js`,
sourceMapFilename: `erebos.swarm.${envName}.js.map`,
library: ['Erebos', 'swarm'],
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
module.exports = {
bail: isProduction,
mode: envName,
devtool: isProduction ? 'source-map' : 'cheap-module-source-map',
entry: [path.join(__dirname, `src`, 'index.ts')],
output: {
path: path.join(__dirname, `dist/`),
filename: `erebos.swarm.${envName}.js`,
sourceMapFilename: `erebos.swarm.${envName}.js.map`,
library: ['Erebos', 'swarm'],
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: info => {
return path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')
},
module: {
rules: [
{
test: /\.(ts|js)$/,
include: path.join(__dirname, `src/`),
use: {
loader: 'babel-loader',
},
},
module: {
rules: [
{
test: /\.(ts|js)$/,
include: path.join(__dirname, `src/`),
use: {
loader: 'babel-loader',
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
optimization: {
minimize: isProduction,
minimizer: [
// This is only used in production mode
new TerserPlugin({
terserOptions: {
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minfication steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
},
mangle: {
safari10: true,
},
output: {
ecma: 5,
comments: false,
},
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
optimization: {
minimize: isProduction,
minimizer: [
// This is only used in production mode
new TerserPlugin({
terserOptions: {
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minfication steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
parallel: true,
// Enable file caching
cache: true,
sourceMap: true,
}),
],
},
target: 'web',
node: {
console: false,
global: true,
process: true,
Buffer: true,
},
performance: {
hints: false,
},
stats: 'minimal',
}
}

const readable = () => {
return {
bail: false,
mode: 'development',
devtool: 'cheap-module-source-map',
entry: path.join(__dirname, `..`, '..', 'node_modules', 'readable-stream', 'readable-browser.js'),
output: {
path: path.join(__dirname, `dist/`),
filename: `readable-stream.js`,
sourceMapFilename: `readable-stream.js.map`,
library: 'NodeStream',
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
node: {
Buffer: true,
},
target: 'web',
stats: 'minimal',
}
}

module.exports = () => {
return isProduction ? main() : [main(), readable()]
compress: {
ecma: 5,
warnings: false,
},
mangle: {
safari10: true,
},
output: {
ecma: 5,
comments: false,
},
},
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
parallel: true,
// Enable file caching
cache: true,
sourceMap: true,
}),
],
},
target: 'web',
node: {
console: false,
global: true,
process: true,
Buffer: true,
},
performance: {
hints: false,
},
stats: 'minimal',
}

0 comments on commit 39dedf6

Please sign in to comment.