Skip to content

Commit a4f918b

Browse files
committed
Replace webpack with rollup
1 parent 32bc048 commit a4f918b

File tree

8 files changed

+232
-1747
lines changed

8 files changed

+232
-1747
lines changed

.babelrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
2-
"presets": [["env"]]
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false
7+
}
8+
]
9+
],
10+
"plugins": [
11+
"external-helpers"
12+
]
313
}

dist/vue-sanitize.js

Lines changed: 25 additions & 13 deletions
Large diffs are not rendered by default.

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const sanitizeHtml = require("sanitize-html");
2+
3+
const VueSanitize = {
4+
install(Vue, options) {
5+
const defaultOptions = options;
6+
7+
Vue.prototype.$sanitize = (dirty, opts = null) =>
8+
sanitizeHtml(dirty, opts || defaultOptions);
9+
},
10+
11+
defaults: sanitizeHtml.defaults
12+
};
13+
14+
export default VueSanitize;

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "vue-sanitize",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Whitelist-based HTML sanitizer for Vue.js apps.",
55
"homepage": "https://github.com/daichirata/vue-sanitize",
66
"main": "dist/vue-sanitize.js",
7-
"jsnext:main": "src/index.js",
7+
"jsnext:main": "index.js",
88
"scripts": {
9-
"build": "webpack"
9+
"build": "rollup -c --name vue-sanitize --input index.js"
1010
},
1111
"keywords": [
1212
"vue-sanitize",
@@ -18,20 +18,19 @@
1818
"type": "git",
1919
"url": "https://github.com/daichirata/vue-sanitize.git"
2020
},
21-
"files": [
22-
"dist",
23-
"src"
24-
],
2521
"author": "Daichi HIRATA <[email protected]>",
2622
"license": "MIT",
2723
"dependencies": {
2824
"sanitize-html": "^1.14.1"
2925
},
3026
"devDependencies": {
3127
"babel-core": "^6.26.0",
32-
"babel-loader": "^7.1.2",
28+
"babel-plugin-external-helpers": "^6.22.0",
3329
"babel-preset-env": "^1.6.1",
34-
"clean-webpack-plugin": "^0.1.17",
35-
"webpack": "^3.8.1"
30+
"prettier": "^1.12.0",
31+
"rollup": "^0.57.1",
32+
"rollup-plugin-babel": "^3.0.3",
33+
"rollup-plugin-commonjs": "^9.1.0",
34+
"rollup-plugin-node-resolve": "^3.3.0"
3635
}
3736
}

rollup.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import babel from "rollup-plugin-babel";
2+
import nodeResolve from "rollup-plugin-node-resolve";
3+
4+
export default {
5+
output: {
6+
file: "dist/vue-sanitize.js",
7+
format: "umd"
8+
},
9+
plugins: [babel(), nodeResolve({ jsnext: true, main: true })]
10+
};

src/index.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

webpack.config.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)