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

Commit

Permalink
fix: browser-mfs example (#2089)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and Alan Shaw committed May 21, 2019
1 parent aaddbbd commit e7d6d3a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
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

0 comments on commit e7d6d3a

Please sign in to comment.