Git Product home page Git Product logo

esbuild-plugin-text-replace's People

Contributors

aheissenberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zhijs

esbuild-plugin-text-replace's Issues

can't be use with latest esbuild

Hello,

I'm trying to use your plugin, however looks like the interface is not oudated with the esbuild interface (I'm using latest esbuild, 0.14.19)

CleanShot 2022-02-07 at 09 23 18@2x

Cannot import version 1.1.2

Hi, if I try to import/require version 1.1.2 I get this error.

$ node -e "require('esbuild-plugin-text-replace')"
internal/modules/cjs/loader.js:438
      throw e;
      ^

Error [ERR_INVALID_PACKAGE_CONFIG]: Invalid package config /Users/riccardo.galli/some-project/node_modules/esbuild-plugin-text-replace/package.json. "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.
    at isConditionalExportsMainSugar (internal/modules/esm/resolve.js:449:13)
    at packageExportsResolve (internal/modules/esm/resolve.js:470:7)
    at resolveExports (internal/modules/cjs/loader.js:432:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:133:18) {
  code: 'ERR_INVALID_PACKAGE_CONFIG'
}

The same code works just fine with version 1.1.1

Support file path patterns that compatible for both windows and linux

Hi Andreas, thanks for the very helpful plugin.
I got an issue with the path pattern on Windows and Linux.

For instance, on windows the file path is using \ for directory and Linux is using /, we can still use (\\|\/) in the file pattern but it would be quite clumsy in the config. Is it possible to support both Windows and Linux paths without the hack? Thanks :D

textReplace({
  include: /some\/nested\/directory\/file\.ts$/,     //  for linux
  // include: /some\\nested\\directory\\file\.ts$/,  // for windows
  pattern: [
    ['__CONTENT_TO_BE_REPLACED__', 'replaced str'],
  ]
})

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.