mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge branch 'master' of http://github.com/amark/gun
This commit is contained in:
commit
525d834784
@ -1,5 +1,5 @@
|
||||
*.ts
|
||||
/temp/
|
||||
!*.d.ts
|
||||
*data*
|
||||
*.radata
|
||||
isolate-*
|
||||
|
3
examples/webpack/.gitignore
vendored
Normal file
3
examples/webpack/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
package-lock.json
|
||||
node_modules
|
||||
public
|
17
examples/webpack/package.json
Normal file
17
examples/webpack/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "webpack",
|
||||
"version": "1.0.0",
|
||||
"description": "webpack build example",
|
||||
"scripts": {
|
||||
"build": "webpack --devtool source-map --config webpack.config.js",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"gun": "github:amark/gun",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"webpack": "^5.72.1",
|
||||
"webpack-cli": "^4.9.2"
|
||||
}
|
||||
}
|
9
examples/webpack/src/app.js
Normal file
9
examples/webpack/src/app.js
Normal file
@ -0,0 +1,9 @@
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var Gun = require("gun");
|
||||
|
||||
var gun = new Gun();
|
||||
|
||||
gun.get("hello").get("world").put("from gun").on((data, key) => console.log(data, key));
|
||||
|
||||
});
|
5
examples/webpack/src/index.html
Normal file
5
examples/webpack/src/index.html
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head></head>
|
||||
<body></body>
|
||||
</html>
|
35
examples/webpack/webpack.config.js
Normal file
35
examples/webpack/webpack.config.js
Normal file
@ -0,0 +1,35 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
let plugins = [];
|
||||
|
||||
plugins.push(new HtmlWebpackPlugin({
|
||||
filename: './index.html',
|
||||
template: './src/index.html',
|
||||
inject: true,
|
||||
minify: false,
|
||||
hash: false,
|
||||
cache: false,
|
||||
showErrors: false
|
||||
}));
|
||||
|
||||
console.log("webpack config loaded");
|
||||
|
||||
module.exports = {
|
||||
|
||||
mode: "development",
|
||||
|
||||
// stats: 'minimal',
|
||||
stats: 'normal',
|
||||
// stats: 'verbose',
|
||||
|
||||
entry: [path.resolve(__dirname, './src/app.js')],
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, './public'),
|
||||
clean: true,
|
||||
filename: './app.js'
|
||||
},
|
||||
|
||||
plugins: plugins
|
||||
};
|
@ -8,6 +8,7 @@
|
||||
"ios": "browser.ios.js",
|
||||
"android": "browser.android.js",
|
||||
"scripts": {
|
||||
"prepare": "npm run unbuildSea && npm run unbuild",
|
||||
"start": "node --prof examples/http.js",
|
||||
"debug": "node --prof-process --preprocess -j isolate*.log > v8data.json && rm isolate*.log && echo 'drag & drop ./v8data.json into https://mapbox.github.io/flamebearer/'",
|
||||
"https": "HTTPS_KEY=test/https/server.key HTTPS_CERT=test/https/server.crt npm start",
|
||||
@ -18,6 +19,7 @@
|
||||
"docker": "hooks/build",
|
||||
"minify": "uglifyjs gun.js -o gun.min.js -c -m",
|
||||
"unbuild": "node lib/unbuild.js & npm run minify",
|
||||
"unbuildSea": "node lib/unbuild.js sea",
|
||||
"unbuildMeta": "node lib/unbuild.js lib/meta"
|
||||
},
|
||||
"repository": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user