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 2 years ago

thewebartisan7 commented 2 years 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 2 years ago

Seem fixed, not sure how