Coder Social home page Coder Social logo

regex for 'excludes' option? about offline-plugin HOT 6 CLOSED

nekr avatar nekr commented on August 19, 2024
regex for 'excludes' option?

from offline-plugin.

Comments (6)

NekR avatar NekR commented on August 19, 2024

Hi! In excludes property and in most others you can just use pattern matching, e.g. excludes: 'icon-*' will exclude everything what starts with icon-.

from offline-plugin.

jackyon avatar jackyon commented on August 19, 2024

hi @NekR, thx for reply, I have tried that before, but seems not working, now I figure out the problem might be from FaviconsWebpackPlugin, the icons were generate by this plugin, I found the excludes option works every pattern except 'icons-*'

my webpack plugin config:

new FaviconsWebpackPlugin({
    logo: './app/public/react-logo.png',
    title: 'react app'
}),
new OfflinePlugin({
    publicPath: '/assets/',
    relativePaths: false,
    excludes: ['icons-*', '**/.*']
}),

screen shot 2016-05-16 at 11 50 16 pm

from offline-plugin.

NekR avatar NekR commented on August 19, 2024

@jackyon yep, might be related to that plugin, depends on how it's implemented. I'll look into it. Thanks for reporting!

from offline-plugin.

NekR avatar NekR commented on August 19, 2024

Okay, this seems to be a problem of minimatch, its wildcards work in some weird way, e.g. icons-* doesn't match dirs and icons-*/** doesn't match hidden files (files with leading dot, e.g. .cache). So you have to use something like this (it works for me):

excludes: ['icons-*/{*.*,.*}'],

But I guess it's better to switch off from minimatch (in future) so something else which works better here.

... or I just have to properly configure minimatch to work in this cases.

from offline-plugin.

jackyon avatar jackyon commented on August 19, 2024

@NekR , thx for your solution, it works!

from offline-plugin.

NekR avatar NekR commented on August 19, 2024

Great! Closing then. I'll think on how to improve pattern matching here.

from offline-plugin.

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.