posthtml / posthtml-expressions

Use variables, JS-like expressions, and even markup-powered logic in your HTML.
Other
123 stars 20 forks source link

Set posthtml expression options in posthtml-loader #131

Closed thewebartisan7 closed 1 year ago

thewebartisan7 commented 1 year ago

Posting here the same question that I open here https://github.com/posthtml/posthtml-loader/issues/134

I hope someone can explain how to setup options with posthtml-loaded

When I try to add posthtml expression options then it fail:

options: {
              plugins: [
                require("posthtml-expressions")({
                  removeScriptLocals: true 
                }),
                require("posthtml-extend")({
                  encoding: "utf8",
                  root: "./src/"
                }),
              ],
            },

Error:

ERROR in Error: Child compilation failed: Module build failed (from ./node_modules/posthtml-loader/lib/index.js): PostHTML Loader:

SyntaxError: Unexpected identifier

at node_modules/posthtml-loader/lib/index.js:158:10

ModuleBuildError: Module build failed (from ./node_modules/posthtml-loader/lib/index.js):

thewebartisan7 commented 1 year ago

Seem fixed, not sure how