Skip to content

flags: 'g' not working #24

@inzanez

Description

@inzanez

Hi

I've been trying to get string-replace-loader to work with the 'g' flag.

...

    loader: 'string-replace-loader',
    query: {
      search: 'REST_API',
      replace: 'test',
      flags: 'g'
    }

That doesn't seem to work out. If I remove the 'g' flag and set '' or 'i' as flag, it works perfectly. But 'g' flag always brings back the following error:

ERROR in ./~/css-loader?sourceMap!./~/vue-loader/lib/style-compiler?{"id":"data-v-84da6350","scoped":false,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./~/string-replace-loader?{"search":{},"replace":"test","flags":"g"}!./src/components/something/Test.vue
Module build failed: TypeError: Cannot read property 'content' of undefined
    at Object.module.exports (/home/inzanez/WebDevel/testapp/node_modules/vue-loader/lib/selector.js:18:27)
 @ ./~/vue-style-loader!./~/css-loader?sourceMap!./~/vue-loader/lib/style-compiler?{"id":"data-v-84da6350","scoped":false,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./~/string-replace-loader?{"search":{},"replace":"test","flags":"g"}!./src/components/something/Test.vue 4:14-409 13:3-17:5 14:22-417
 @ ./src/components/something/Test.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Any idea what might be wrong here?oO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions