file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.32k stars 250 forks source link

Webpack files not proper icons #748

Closed hyperupcall closed 6 years ago

hyperupcall commented 6 years ago

Replacing webpack.config.js with webpack.common.js, webpack.dev.js, and webpack.prod.js (as per https://webpack.js.org/guides/production/) yielded an unexpected result.

Neither webpack.common.js, webpack.dev.js, nor the webpack.prod.js file had the proper Webpack file icon (which was associated with webpack.config.js).

Could the scope of the Webpack icon be changed to add these specific file names? I tried to add them manually, but avoided this as I did not want my changes to be overridden by an update.

Alhadis commented 6 years ago

Ugh, you're right. Currently, it's expecting conf or config to be part of the filename. 😞

Would the following pattern work?

match: ///
    (^|\.)    # Start of file, or something following a dot (such as "dev.webpack.js")
    webpack
    (file)?   # For "webpackfile.js"
    (?=\.)    # Followed by a dot
    .*        # Stuff like ".config" or ".development" or ".production.config", etc
    \.
    (js|jsx|ts|tsx|json)
    $
///i

This matches any filename that starts with webpack. and ends in a supported file extension: js, jsx, ts, tsx, or json.

Alhadis commented 6 years ago

Never mind. I realised it was silly to be cautious when Webpack can't stop changing its APIs anyway... 😀