Skip to content

Commit

Permalink
Replace webpack with rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
daichirata committed Apr 13, 2018
1 parent 32bc048 commit a4f918b
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 1,747 deletions.
12 changes: 11 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"presets": [["env"]]
"presets": [
[
"env",
{
"modules": false
}
]
],
"plugins": [
"external-helpers"
]
}
38 changes: 25 additions & 13 deletions dist/vue-sanitize.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const sanitizeHtml = require("sanitize-html");

const VueSanitize = {
install(Vue, options) {
const defaultOptions = options;

Vue.prototype.$sanitize = (dirty, opts = null) =>
sanitizeHtml(dirty, opts || defaultOptions);
},

defaults: sanitizeHtml.defaults
};

export default VueSanitize;
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "vue-sanitize",
"version": "0.1.0",
"version": "0.2.0",
"description": "Whitelist-based HTML sanitizer for Vue.js apps.",
"homepage": "https://github.com/daichirata/vue-sanitize",
"main": "dist/vue-sanitize.js",
"jsnext:main": "src/index.js",
"jsnext:main": "index.js",
"scripts": {
"build": "webpack"
"build": "rollup -c --name vue-sanitize --input index.js"
},
"keywords": [
"vue-sanitize",
Expand All @@ -18,20 +18,19 @@
"type": "git",
"url": "https://github.com/daichirata/vue-sanitize.git"
},
"files": [
"dist",
"src"
],
"author": "Daichi HIRATA <daichirata@gmail.com>",
"license": "MIT",
"dependencies": {
"sanitize-html": "^1.14.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.6.1",
"clean-webpack-plugin": "^0.1.17",
"webpack": "^3.8.1"
"prettier": "^1.12.0",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-node-resolve": "^3.3.0"
}
}
10 changes: 10 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import babel from "rollup-plugin-babel";
import nodeResolve from "rollup-plugin-node-resolve";

export default {
output: {
file: "dist/vue-sanitize.js",
format: "umd"
},
plugins: [babel(), nodeResolve({ jsnext: true, main: true })]
};
17 changes: 0 additions & 17 deletions src/index.js

This file was deleted.

33 changes: 0 additions & 33 deletions webpack.config.js

This file was deleted.

Loading

0 comments on commit a4f918b

Please sign in to comment.