Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: browser-mfs example #2089

Merged
merged 1 commit into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/browser-mfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"devDependencies": {
"html-webpack-plugin": "^3.2.0",
"http-server": "~0.11.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.15.1",
"terser-webpack-plugin": "^1.2.1",
"webpack": "^4.28.4",
"webpack-cli": "^3.0.8"
},
"dependencies": {
Expand Down
42 changes: 34 additions & 8 deletions examples/browser-mfs/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
Expand All @@ -11,18 +11,44 @@ module.exports = {
'./index.js'
],
plugins: [
new UglifyJsPlugin({
sourceMap: true,
uglifyOptions: {
mangle: false,
compress: false
}
}),
new HtmlWebpackPlugin({
title: 'IPFS MFS example',
template: 'index.html'
})
],
optimization: {
minimizer: [
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
}
},
// 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
})
]
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
Expand Down