w-data-html-minify 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/README.md +36 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +15 -0
- package/dist/w-data-html-minify.umd.js +7 -0
- package/dist/w-data-html-minify.umd.js.map +1 -0
- package/docs/WDataHtmlMinify.mjs.html +134 -0
- package/docs/examples/ex-html-minify.html +94 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/global.html +459 -0
- package/docs/htmlminifier.js.html +26278 -0
- package/docs/importHtmlminify.mjs.html +107 -0
- package/docs/index.html +84 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/examples/ex-html-minify.html +94 -0
- package/g.test.minify.mjs +15 -0
- package/package.json +31 -0
- package/src/WDataHtmlMinify.mjs +62 -0
- package/src/_convertHtmlminifierCode.mjs +24 -0
- package/src/_htmlminifierCoreBrowser.mjs +1 -0
- package/src/_importHtmlminifierBrowser.mjs +46 -0
- package/src/_importHtmlminifierNode.mjs +7 -0
- package/src/htmlminifier.js +26206 -0
- package/src/htmlminifier.min.js +7 -0
- package/src/importHtmlminify.mjs +35 -0
- package/src/rq.js +3 -0
- package/test/all.test.mjs +20 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +4 -0
- package/toolg/gDistRollup.mjs +46 -0
- package/toolg/gDocsExams.mjs +48 -0
- package/toolg/modifyReadme.mjs +4 -0
package/.editorconfig
ADDED
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'env': {
|
|
3
|
+
'browser': true,
|
|
4
|
+
'es6': true,
|
|
5
|
+
'mocha': true
|
|
6
|
+
},
|
|
7
|
+
'extends': ['plugin:vue/base', 'plugin:vue/essential', 'standard'],
|
|
8
|
+
'plugins': [
|
|
9
|
+
'vue'
|
|
10
|
+
],
|
|
11
|
+
'globals': {
|
|
12
|
+
'Atomics': 'readonly',
|
|
13
|
+
'SharedArrayBuffer': 'readonly'
|
|
14
|
+
},
|
|
15
|
+
'parser': 'vue-eslint-parser',
|
|
16
|
+
'parserOptions': {
|
|
17
|
+
'parser': '@babel/eslint-parser',
|
|
18
|
+
'ecmaVersion': 2019,
|
|
19
|
+
'sourceType': 'module',
|
|
20
|
+
},
|
|
21
|
+
'rules': {
|
|
22
|
+
'generator-star-spacing': 'off',
|
|
23
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
24
|
+
'indent': ['error', 4],
|
|
25
|
+
'no-console': 'off',
|
|
26
|
+
'comma-dangle': ['error', {
|
|
27
|
+
'arrays': 'ignore',
|
|
28
|
+
'objects': 'ignore',
|
|
29
|
+
'imports': 'never',
|
|
30
|
+
'exports': 'never',
|
|
31
|
+
'functions': 'ignore'
|
|
32
|
+
}],
|
|
33
|
+
'no-multiple-empty-lines': ['error', { 'max': 2, 'maxEOF': 2 }],
|
|
34
|
+
//'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never' }],
|
|
35
|
+
'space-before-function-paren': 'off',
|
|
36
|
+
'spaced-comment': 'off',
|
|
37
|
+
'brace-style': ['error', 'stroustrup'],
|
|
38
|
+
'padded-blocks': 'off',
|
|
39
|
+
'no-constant-condition': 'off',
|
|
40
|
+
'camelcase': 'off',
|
|
41
|
+
'no-new': 'off',
|
|
42
|
+
'prefer-const': 'off',
|
|
43
|
+
'quote-props': ['error', 'consistent'],
|
|
44
|
+
'dot-notation': 'off',
|
|
45
|
+
'standard/no-callback-literal': 'off',
|
|
46
|
+
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
|
|
47
|
+
'prefer-promise-reject-errors': 'off',
|
|
48
|
+
'no-unused-vars': ['error', { 'args': 'none', 'ignoreRestSiblings': true, 'argsIgnorePattern': '^_' }],
|
|
49
|
+
'node/no-callback-literal': 'off',
|
|
50
|
+
'prefer-regex-literals': 'off',
|
|
51
|
+
'array-callback-return': 'off',
|
|
52
|
+
'no-unreachable-loop': 'off',
|
|
53
|
+
'vue/multi-word-component-names': 'off',
|
|
54
|
+
}
|
|
55
|
+
}
|
package/.jsdoc
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tags": {
|
|
3
|
+
"allowUnknownTags": false
|
|
4
|
+
},
|
|
5
|
+
"source": {
|
|
6
|
+
"include": ["src/", "server/"],
|
|
7
|
+
"includePattern": ".+\\.(js(doc|x)?|mjs|vue)$",
|
|
8
|
+
"excludePattern": "(node_modules/|docs)"
|
|
9
|
+
},
|
|
10
|
+
"plugins": [
|
|
11
|
+
"plugins/markdown",
|
|
12
|
+
"node_modules/jsdoc-vuejs"
|
|
13
|
+
],
|
|
14
|
+
"opts": {
|
|
15
|
+
"template": "node_modules/docdash",
|
|
16
|
+
"encoding": "utf8",
|
|
17
|
+
"destination": "docs/",
|
|
18
|
+
"recurse": true,
|
|
19
|
+
"verbose": true
|
|
20
|
+
},
|
|
21
|
+
"templates": {
|
|
22
|
+
"cleverLinks": false,
|
|
23
|
+
"monospaceLinks": false
|
|
24
|
+
}
|
|
25
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# w-data-html-minify
|
|
2
|
+
A tool for minify html.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
[](https://npmjs.org/package/w-data-html-minify)
|
|
6
|
+
[](https://npmjs.org/package/w-data-html-minify)
|
|
7
|
+
[](https://github.com/yuda-lyu/w-data-html-minify)
|
|
8
|
+
[](https://npmjs.org/package/w-data-html-minify)
|
|
9
|
+
[](https://www.jsdelivr.com/package/npm/w-data-html-minify)
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-data-html-minify/global.html).
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
### Using npm(ES6 module):
|
|
16
|
+
> **Note:** w-data-html-minify is mainly dependent on `html-minifier`.
|
|
17
|
+
```alias
|
|
18
|
+
npm i w-data-html-minify
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### Example:
|
|
22
|
+
> **Link:** [[dev source code](https://github.com/yuda-lyu/w-data-html-minify/blob/master/g-read.mjs)]
|
|
23
|
+
```alias
|
|
24
|
+
import wdc from './src/WDataHtmlMinify.mjs'
|
|
25
|
+
|
|
26
|
+
let hin = `
|
|
27
|
+
<html>
|
|
28
|
+
<head></head>
|
|
29
|
+
<body>abc</body>
|
|
30
|
+
</html>
|
|
31
|
+
`
|
|
32
|
+
let hout = wdhm(hin)
|
|
33
|
+
console.log(hout)
|
|
34
|
+
// => <html><head></head><body>abc</body></html>
|
|
35
|
+
|
|
36
|
+
```
|
package/SECURITY.md
ADDED
package/babel.config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'presets': [
|
|
3
|
+
['@babel/preset-env', {
|
|
4
|
+
'useBuiltIns': 'entry',
|
|
5
|
+
'corejs': 3
|
|
6
|
+
}]
|
|
7
|
+
],
|
|
8
|
+
'plugins': [
|
|
9
|
+
'@babel/plugin-transform-runtime',
|
|
10
|
+
'@babel/plugin-syntax-import-assertions',
|
|
11
|
+
'@babel/plugin-proposal-export-default-from',
|
|
12
|
+
'@babel/plugin-proposal-nullish-coalescing-operator',
|
|
13
|
+
'@babel/plugin-proposal-optional-chaining'
|
|
14
|
+
]
|
|
15
|
+
}
|