Code Monkey home page Code Monkey logo

Comments (4)

Durss avatar Durss commented on June 3, 2024 1

Some more info.

I tried to copy/paste the plugin to my local folder, removed all the external dependencies, and i still have the problem.

If i log the raw options, any Function typed param get stripped out the object.
I'm starting to think it might actually be an issue with Vue-Cli as i'm using it in a Vue project.

The way to use a plugin with Vue env is a bit special (not sure it's specific to Vue actually) as it looks like this :

	chainWebpack: (config) => {
		config.module.rule()
		.test(/\.ts$/)
		.use()
		.loader("./local-string-replace")
		.options({
			multiple: [
			   {
					search: 'hello',
					flags: 'gi',
					testRep: function(match, p1, offset, string) {
						return "test?"
					},
					replace: function(match, p1, offset, string) {
						return "morning!";
					},
				},
			]
		  }
		);
	},

Maybe there's some sanitazing somewhere that cleansup params to remove potentially sensitive stuff like function calls...
Again, quite new to webpack so i might be missing something obvious.

from string-replace-loader.

williamweckl avatar williamweckl commented on June 3, 2024

I`m experiencing the same issue. @Durss did you find a solution?

from string-replace-loader.

Durss avatar Durss commented on June 3, 2024

Nope i just created something from scratch more or less equivalent to this plugin that answered my needs :/

from string-replace-loader.

Va1 avatar Va1 commented on June 3, 2024

hi. there' a test-case written for the callback replacement and it works. can you check if that's approximately how you're approaching callback replacement as well? thanks

https://github.com/Va1/string-replace-loader/blob/master/test/index.test.js#L135

from string-replace-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.