mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Revert webpack.config.js to original orbitdb one
This commit is contained in:
parent
9212aaa224
commit
96a6d4fba8
@ -1,26 +1,55 @@
|
||||
import path from 'path'
|
||||
import webpack from 'webpack'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { createRequire } from 'module'
|
||||
|
||||
export default (env, argv) => {
|
||||
const require = createRequire(import.meta.url)
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
|
||||
return {
|
||||
entry: './src/log.js',
|
||||
mode: 'production',
|
||||
entry: './src/OrbitDB.js',
|
||||
output: {
|
||||
libraryTarget: 'var',
|
||||
library: 'Log',
|
||||
filename: 'ipfslog.min.js'
|
||||
filename: '../dist/orbitdb.min.js',
|
||||
library: {
|
||||
name: 'OrbitDB',
|
||||
type: 'var',
|
||||
export: 'default'
|
||||
}
|
||||
},
|
||||
target: 'web',
|
||||
mode: 'production',
|
||||
externals: {
|
||||
fs: '{ existsSync: () => true }',
|
||||
mkdirp: '{}'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
process: 'process/browser',
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
modules: [
|
||||
'node_modules',
|
||||
path.resolve(__dirname, '../node_modules')
|
||||
]
|
||||
],
|
||||
fallback: {
|
||||
path: require.resolve('path-browserify'),
|
||||
os: false,
|
||||
fs: false,
|
||||
constants: false,
|
||||
stream: false
|
||||
}
|
||||
},
|
||||
resolveLoader: {
|
||||
modules: [
|
||||
'node_modules',
|
||||
path.resolve(__dirname, '../node_modules')
|
||||
],
|
||||
extensions: ['.js', '.json'],
|
||||
mainFields: ['loader', 'main']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user