@maizzle/framework 3.6.2 → 3.7.3
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/.github/dependabot.yml +11 -11
- package/.github/workflows/nodejs.yml +29 -29
- package/package.json +84 -84
- package/src/generators/output/to-string.js +68 -64
- package/src/generators/posthtml.js +60 -60
- package/src/generators/tailwindcss.js +84 -84
- package/src/transformers/base-image-url.js +1 -2
- package/src/transformers/six-hex.js +10 -10
- package/test/expected/transformers/base-image-url.html +7 -0
- package/test/fixtures/basic.html +9 -0
- package/test/fixtures/transformers/base-image-url.html +7 -0
- package/test/test-misc.js +8 -8
- package/test/test-tailwind.js +73 -73
- package/test/test-todisk.js +1 -1
- package/test/test-tostring.js +4 -3
- package/test/test-transformers.js +320 -314
- package/xo.config.js +1 -0
package/.github/dependabot.yml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
- package-ecosystem: npm
|
|
4
|
-
directory: "/"
|
|
5
|
-
schedule:
|
|
6
|
-
interval:
|
|
7
|
-
open-pull-requests-limit: 10
|
|
8
|
-
ignore:
|
|
9
|
-
- dependency-name: html-crush
|
|
10
|
-
versions:
|
|
11
|
-
- 4.1.0
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: npm
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
ignore:
|
|
9
|
+
- dependency-name: html-crush
|
|
10
|
+
versions:
|
|
11
|
+
- 4.1.0
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: Node.js CI
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [master]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [master]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
|
|
16
|
-
strategy:
|
|
17
|
-
matrix:
|
|
18
|
-
node-version: [12, 14, 16]
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v2
|
|
22
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
-
uses: actions/setup-node@v1
|
|
24
|
-
with:
|
|
25
|
-
node-version: ${{ matrix.node-version }}
|
|
26
|
-
- run: npm install
|
|
27
|
-
- run: npm test
|
|
28
|
-
env:
|
|
29
|
-
CI: true
|
|
1
|
+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Node.js CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [master]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [master]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: [12, 14, 16]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v2
|
|
22
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v1
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
- run: npm install
|
|
27
|
+
- run: npm test
|
|
28
|
+
env:
|
|
29
|
+
CI: true
|
package/package.json
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@maizzle/framework",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"main": "src/index.js",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/maizzle/framework.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": "https://github.com/maizzle/framework/issues",
|
|
12
|
-
"homepage": "https://maizzle.com",
|
|
13
|
-
"author": "Cosmin Popovici (https://github.com/cossssmin)",
|
|
14
|
-
"keywords": [
|
|
15
|
-
"maizzle",
|
|
16
|
-
"tailwindcss",
|
|
17
|
-
"responsive-email",
|
|
18
|
-
"email-framework",
|
|
19
|
-
"email-template",
|
|
20
|
-
"email-marketing",
|
|
21
|
-
"email-campaigns",
|
|
22
|
-
"email-newsletter",
|
|
23
|
-
"email-boilerplate",
|
|
24
|
-
"html-emails"
|
|
25
|
-
],
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"test": "xo && nyc ava -s",
|
|
31
|
-
"style": "xo",
|
|
32
|
-
"release": "np"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"browser-sync": "^2.26.13",
|
|
36
|
-
"color-shorthand-hex-to-six-digit": "^3.0.2",
|
|
37
|
-
"email-comb": "^5.0.0",
|
|
38
|
-
"front-matter": "^4.0.0",
|
|
39
|
-
"fs-extra": "^10.0.0",
|
|
40
|
-
"glob-promise": "^4.1.0",
|
|
41
|
-
"html-crush": "^4.0.0",
|
|
42
|
-
"juice": "^8.0.0",
|
|
43
|
-
"lodash": "^4.17.20",
|
|
44
|
-
"ora": "^5.1.0",
|
|
45
|
-
"postcss": "^8.2.14",
|
|
46
|
-
"postcss-import": "^14.0.0",
|
|
47
|
-
"postcss-merge-longhand": "^5.0.1",
|
|
48
|
-
"posthtml": "^0.16.4",
|
|
49
|
-
"posthtml-attrs-parser": "^0.1.1",
|
|
50
|
-
"posthtml-content": "^0.0.3",
|
|
51
|
-
"posthtml-expressions": "1.
|
|
52
|
-
"posthtml-extend": "^0.6.0",
|
|
53
|
-
"posthtml-extra-attributes": "^1.0.0",
|
|
54
|
-
"posthtml-fetch": "^2.0.0",
|
|
55
|
-
"posthtml-markdownit": "^1.2.2",
|
|
56
|
-
"posthtml-modules": "^0.7.4",
|
|
57
|
-
"posthtml-mso": "^1.0.2",
|
|
58
|
-
"posthtml-postcss-merge-longhand": "^1.0.2",
|
|
59
|
-
"posthtml-remove-attributes": "^1.0.0",
|
|
60
|
-
"posthtml-safe-class-names": "^1.0.4",
|
|
61
|
-
"posthtml-url-parameters": "^1.0.4",
|
|
62
|
-
"pretty": "^2.0.0",
|
|
63
|
-
"prevent-widows": "^1.0.2",
|
|
64
|
-
"query-string": "^7.0.0",
|
|
65
|
-
"string-strip-html": "^8.2.0",
|
|
66
|
-
"tailwindcss": "^2.2.2",
|
|
67
|
-
"tailwindcss-box-shadow": "^1.0.0"
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"autoprefixer": "^10.0.2",
|
|
71
|
-
"ava": "^3.13.0",
|
|
72
|
-
"np": "*",
|
|
73
|
-
"nyc": "^15.1.0",
|
|
74
|
-
"xo": "
|
|
75
|
-
},
|
|
76
|
-
"engines": {
|
|
77
|
-
"node": ">=12.13.0"
|
|
78
|
-
},
|
|
79
|
-
"ava": {
|
|
80
|
-
"files": [
|
|
81
|
-
"test/**/test*.js"
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@maizzle/framework",
|
|
3
|
+
"version": "3.7.3",
|
|
4
|
+
"description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/maizzle/framework.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/maizzle/framework/issues",
|
|
12
|
+
"homepage": "https://maizzle.com",
|
|
13
|
+
"author": "Cosmin Popovici (https://github.com/cossssmin)",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"maizzle",
|
|
16
|
+
"tailwindcss",
|
|
17
|
+
"responsive-email",
|
|
18
|
+
"email-framework",
|
|
19
|
+
"email-template",
|
|
20
|
+
"email-marketing",
|
|
21
|
+
"email-campaigns",
|
|
22
|
+
"email-newsletter",
|
|
23
|
+
"email-boilerplate",
|
|
24
|
+
"html-emails"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "xo && nyc ava -s",
|
|
31
|
+
"style": "xo",
|
|
32
|
+
"release": "np"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"browser-sync": "^2.26.13",
|
|
36
|
+
"color-shorthand-hex-to-six-digit": "^3.0.2",
|
|
37
|
+
"email-comb": "^5.0.0",
|
|
38
|
+
"front-matter": "^4.0.0",
|
|
39
|
+
"fs-extra": "^10.0.0",
|
|
40
|
+
"glob-promise": "^4.1.0",
|
|
41
|
+
"html-crush": "^4.0.0",
|
|
42
|
+
"juice": "^8.0.0",
|
|
43
|
+
"lodash": "^4.17.20",
|
|
44
|
+
"ora": "^5.1.0",
|
|
45
|
+
"postcss": "^8.2.14",
|
|
46
|
+
"postcss-import": "^14.0.0",
|
|
47
|
+
"postcss-merge-longhand": "^5.0.1",
|
|
48
|
+
"posthtml": "^0.16.4",
|
|
49
|
+
"posthtml-attrs-parser": "^0.1.1",
|
|
50
|
+
"posthtml-content": "^0.0.3",
|
|
51
|
+
"posthtml-expressions": "^1.8.1",
|
|
52
|
+
"posthtml-extend": "^0.6.0",
|
|
53
|
+
"posthtml-extra-attributes": "^1.0.0",
|
|
54
|
+
"posthtml-fetch": "^2.0.0",
|
|
55
|
+
"posthtml-markdownit": "^1.2.2",
|
|
56
|
+
"posthtml-modules": "^0.7.4",
|
|
57
|
+
"posthtml-mso": "^1.0.2",
|
|
58
|
+
"posthtml-postcss-merge-longhand": "^1.0.2",
|
|
59
|
+
"posthtml-remove-attributes": "^1.0.0",
|
|
60
|
+
"posthtml-safe-class-names": "^1.0.4",
|
|
61
|
+
"posthtml-url-parameters": "^1.0.4",
|
|
62
|
+
"pretty": "^2.0.0",
|
|
63
|
+
"prevent-widows": "^1.0.2",
|
|
64
|
+
"query-string": "^7.0.0",
|
|
65
|
+
"string-strip-html": "^8.2.0",
|
|
66
|
+
"tailwindcss": "^2.2.2",
|
|
67
|
+
"tailwindcss-box-shadow": "^1.0.0"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"autoprefixer": "^10.0.2",
|
|
71
|
+
"ava": "^3.13.0",
|
|
72
|
+
"np": "*",
|
|
73
|
+
"nyc": "^15.1.0",
|
|
74
|
+
"xo": "0.39.1"
|
|
75
|
+
},
|
|
76
|
+
"engines": {
|
|
77
|
+
"node": ">=12.13.0"
|
|
78
|
+
},
|
|
79
|
+
"ava": {
|
|
80
|
+
"files": [
|
|
81
|
+
"test/**/test*.js"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
const fm = require('front-matter')
|
|
2
|
-
const {get, merge} = require('lodash')
|
|
3
|
-
const posthtml = require('../posthtml')
|
|
4
|
-
const Tailwind = require('../tailwindcss')
|
|
5
|
-
const Transformers = require('../../transformers')
|
|
6
|
-
const posthtmlMSO = require('../../transformers/posthtml-mso')
|
|
7
|
-
|
|
8
|
-
module.exports = async (html, options) => {
|
|
9
|
-
process.env.NODE_ENV = get(options, 'maizzle.env', 'local')
|
|
10
|
-
|
|
11
|
-
if (typeof html !== 'string') {
|
|
12
|
-
throw new TypeError(`first argument must be an HTML string, received ${html}`)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (html.length === 0) {
|
|
16
|
-
throw new RangeError('received empty string')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let config = get(options, 'maizzle', {})
|
|
20
|
-
|
|
21
|
-
const tailwindConfig = get(options, 'tailwind.config', {})
|
|
22
|
-
const cssString = get(options, 'tailwind.css', '@tailwind components; @tailwind utilities;')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
html =
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
html = await
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
html = await
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
const fm = require('front-matter')
|
|
2
|
+
const {get, merge} = require('lodash')
|
|
3
|
+
const posthtml = require('../posthtml')
|
|
4
|
+
const Tailwind = require('../tailwindcss')
|
|
5
|
+
const Transformers = require('../../transformers')
|
|
6
|
+
const posthtmlMSO = require('../../transformers/posthtml-mso')
|
|
7
|
+
|
|
8
|
+
module.exports = async (html, options) => {
|
|
9
|
+
process.env.NODE_ENV = get(options, 'maizzle.env', 'local')
|
|
10
|
+
|
|
11
|
+
if (typeof html !== 'string') {
|
|
12
|
+
throw new TypeError(`first argument must be an HTML string, received ${html}`)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (html.length === 0) {
|
|
16
|
+
throw new RangeError('received empty string')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let config = get(options, 'maizzle', {})
|
|
20
|
+
|
|
21
|
+
const tailwindConfig = get(options, 'tailwind.config', {})
|
|
22
|
+
const cssString = get(options, 'tailwind.css', '@tailwind components; @tailwind utilities;')
|
|
23
|
+
|
|
24
|
+
let {frontmatter} = fm(html)
|
|
25
|
+
|
|
26
|
+
if (frontmatter) {
|
|
27
|
+
frontmatter = await posthtml(frontmatter, config)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
html = `---\n${frontmatter}\n---\n\n${fm(html).body}`
|
|
31
|
+
|
|
32
|
+
config = merge({applyTransformers: true}, config, fm(html).attributes)
|
|
33
|
+
|
|
34
|
+
if (typeof get(options, 'tailwind.compiled') === 'string') {
|
|
35
|
+
config.css = options.tailwind.compiled
|
|
36
|
+
} else {
|
|
37
|
+
config.css = await Tailwind.compile(cssString, html, tailwindConfig, config)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (options && typeof options.beforeRender === 'function') {
|
|
41
|
+
html = await options.beforeRender(html, config)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
html = await posthtml(html, config)
|
|
45
|
+
|
|
46
|
+
while (Object.keys(fm(html).attributes).length > 0) {
|
|
47
|
+
html = fm(html).body
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (options && typeof options.afterRender === 'function') {
|
|
51
|
+
html = await options.afterRender(html, config)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (config.applyTransformers) {
|
|
55
|
+
html = await Transformers.process(html, config)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (options && typeof options.afterTransformers === 'function') {
|
|
59
|
+
html = await options.afterTransformers(html, config)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
html = await posthtmlMSO(html, config)
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
html,
|
|
66
|
+
config
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
const fm = require('front-matter')
|
|
2
|
-
const posthtml = require('posthtml')
|
|
3
|
-
const {get, merge} = require('lodash')
|
|
4
|
-
const fetch = require('posthtml-fetch')
|
|
5
|
-
const layouts = require('posthtml-extend')
|
|
6
|
-
const modules = require('posthtml-modules')
|
|
7
|
-
const expressions = require('posthtml-expressions')
|
|
8
|
-
|
|
9
|
-
module.exports = async (html, config) => {
|
|
10
|
-
const layoutsOptions = get(config, 'build.layouts', {})
|
|
11
|
-
|
|
12
|
-
const fetchOptions = get(config, 'build.posthtml.fetch', {})
|
|
13
|
-
const fetchPlugin = fetch({...fetchOptions})
|
|
14
|
-
|
|
15
|
-
const modulesOptions = get(config, 'build.components', {})
|
|
16
|
-
// Fake `from` option so we can reference modules relatively
|
|
17
|
-
const modulesRoot = modulesOptions.root || './'
|
|
18
|
-
const modulesFrom = modulesOptions.from || `${modulesRoot}/fake`
|
|
19
|
-
|
|
20
|
-
const posthtmlOptions = get(config, 'build.posthtml.options', {})
|
|
21
|
-
const posthtmlPlugins = get(config, 'build.posthtml.plugins', [])
|
|
22
|
-
|
|
23
|
-
const expressionsOptions = merge({strictMode: false}, get(config, 'build.posthtml.expressions', {}))
|
|
24
|
-
|
|
25
|
-
const locals = merge(
|
|
26
|
-
get(expressionsOptions, 'locals', {}),
|
|
27
|
-
get(config, 'locals', {}),
|
|
28
|
-
{page: config}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
return posthtml([
|
|
32
|
-
fetchPlugin,
|
|
33
|
-
layouts(
|
|
34
|
-
merge(
|
|
35
|
-
{
|
|
36
|
-
strict: false,
|
|
37
|
-
plugins: [
|
|
38
|
-
expressions({...expressionsOptions, locals})
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
layoutsOptions
|
|
42
|
-
)
|
|
43
|
-
),
|
|
44
|
-
modules({
|
|
45
|
-
parser: posthtmlOptions,
|
|
46
|
-
from: modulesFrom,
|
|
47
|
-
root: modulesRoot,
|
|
48
|
-
tag: 'component',
|
|
49
|
-
attribute: 'src',
|
|
50
|
-
plugins: [
|
|
51
|
-
fetchPlugin
|
|
52
|
-
],
|
|
53
|
-
locals,
|
|
54
|
-
...modulesOptions
|
|
55
|
-
}),
|
|
56
|
-
...posthtmlPlugins
|
|
57
|
-
])
|
|
58
|
-
.process(html, {...posthtmlOptions})
|
|
59
|
-
.then(result => fm(result.html).body)
|
|
60
|
-
}
|
|
1
|
+
const fm = require('front-matter')
|
|
2
|
+
const posthtml = require('posthtml')
|
|
3
|
+
const {get, merge} = require('lodash')
|
|
4
|
+
const fetch = require('posthtml-fetch')
|
|
5
|
+
const layouts = require('posthtml-extend')
|
|
6
|
+
const modules = require('posthtml-modules')
|
|
7
|
+
const expressions = require('posthtml-expressions')
|
|
8
|
+
|
|
9
|
+
module.exports = async (html, config) => {
|
|
10
|
+
const layoutsOptions = get(config, 'build.layouts', {})
|
|
11
|
+
|
|
12
|
+
const fetchOptions = get(config, 'build.posthtml.fetch', {})
|
|
13
|
+
const fetchPlugin = fetch({...fetchOptions})
|
|
14
|
+
|
|
15
|
+
const modulesOptions = get(config, 'build.components', {})
|
|
16
|
+
// Fake `from` option so we can reference modules relatively
|
|
17
|
+
const modulesRoot = modulesOptions.root || './'
|
|
18
|
+
const modulesFrom = modulesOptions.from || `${modulesRoot}/fake`
|
|
19
|
+
|
|
20
|
+
const posthtmlOptions = get(config, 'build.posthtml.options', {})
|
|
21
|
+
const posthtmlPlugins = get(config, 'build.posthtml.plugins', [])
|
|
22
|
+
|
|
23
|
+
const expressionsOptions = merge({strictMode: false}, get(config, 'build.posthtml.expressions', {}))
|
|
24
|
+
|
|
25
|
+
const locals = merge(
|
|
26
|
+
get(expressionsOptions, 'locals', {}),
|
|
27
|
+
get(config, 'locals', {}),
|
|
28
|
+
{page: config}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
return posthtml([
|
|
32
|
+
fetchPlugin,
|
|
33
|
+
layouts(
|
|
34
|
+
merge(
|
|
35
|
+
{
|
|
36
|
+
strict: false,
|
|
37
|
+
plugins: [
|
|
38
|
+
expressions({...expressionsOptions, locals})
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
layoutsOptions
|
|
42
|
+
)
|
|
43
|
+
),
|
|
44
|
+
modules({
|
|
45
|
+
parser: posthtmlOptions,
|
|
46
|
+
from: modulesFrom,
|
|
47
|
+
root: modulesRoot,
|
|
48
|
+
tag: 'component',
|
|
49
|
+
attribute: 'src',
|
|
50
|
+
plugins: [
|
|
51
|
+
fetchPlugin
|
|
52
|
+
],
|
|
53
|
+
locals,
|
|
54
|
+
...modulesOptions
|
|
55
|
+
}),
|
|
56
|
+
...posthtmlPlugins
|
|
57
|
+
])
|
|
58
|
+
.process(html, {...posthtmlOptions})
|
|
59
|
+
.then(result => fm(result.html).body)
|
|
60
|
+
}
|