From 87f66c324c537b4dd550e87444d4903713d13211 Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 13 Apr 2018 12:03:50 +0200 Subject: Creation d'un package rollup Buddle Web Editor --- package.json | 10 ++++++- public/edit.html | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ rollup.config.js | 33 +++++++++++++++++++++++ 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 public/edit.html create mode 100644 rollup.config.js diff --git a/package.json b/package.json index 6de1cf5..0a8f14a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "app.js", "scripts": { - "start": "node app.js" + "start": "node app.js", + "build": "./node_modules/.bin/rollup -c" }, "dependencies": { "directory-tree": "^2.0.0", @@ -35,6 +36,13 @@ "license": "", "devDependencies": { "ava": "^0.25.0", + "rollup": "^0.57.1", + "rollup-plugin-commonjs": "^9.1.0", + "rollup-plugin-json": "^2.3.0", + "rollup-plugin-node-builtins": "^2.1.2", + "rollup-plugin-node-globals": "^1.2.0", + "rollup-plugin-node-resolve": "^3.3.0", + "rollup-plugin-uglify": "^3.0.0", "xo": "^0.18.2" }, "xo": { diff --git a/public/edit.html b/public/edit.html new file mode 100644 index 0000000..b1aca3a --- /dev/null +++ b/public/edit.html @@ -0,0 +1,81 @@ + + + + + + hmarkdown example + + + + + + + + + + + +
Yeah x2
+
Yeah !
+ + + + + + diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..20621c9 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,33 @@ +import uglify from 'rollup-plugin-uglify' +import builtins from 'rollup-plugin-node-builtins' +import json from 'rollup-plugin-json' +import commonjs from 'rollup-plugin-commonjs' +import resolve from 'rollup-plugin-node-resolve' +import globals from 'rollup-plugin-node-globals' + + + +export default { + input: 'tohtml.js', + output: { + file: 'public/js/hmd.min.js', + format: 'iife', + sourcemap: 'inline', + name: 'hmd' + }, + plugins: [ + resolve({ + jsnext: true, + browser: true, + main: true, + }), + commonjs(), + builtins(), + json({ + preferConst: true, + }), + globals(), + uglify(), + ] +}; + -- cgit v1.2.3