ztoben / assets-webpack-plugin

Webpack plugin that emits a json file with assets paths
https://www.npmjs.com/package/assets-webpack-plugin
MIT License
957 stars 104 forks source link

Multiple outputs broken by 6.0.6 #314

Open daveisfera opened 3 years ago

daveisfera commented 3 years ago

Describe the bug We use webpack to generate multiple outputs and it works with 6.0 but with 6.1 it only outputs the second group of values and not both the first and second group like it did before.

To Reproduce It's happening in proprietary code, but still working on a minimal reproducer

Expected behavior But groups of outputs would still happen with 6.0.6 like it did with 6.0.5

Webpack Config It's happening in proprietary code, but still working on a minimal reproducer

Desktop (please complete the following information):

daveisfera commented 3 years ago

The break was actually caused by 6.0.6 (I updated the title and original description to reflect that)

ztoben commented 3 years ago

@daveisfera if you can get me a reproduction it'd be appreciated. I think I have an idea of what the problem might be, but it would really help me narrow it down for sure.

daveisfera commented 3 years ago
{
    "/public/js/": {
        "cache": {
            "type": "filesystem"
        },
        "module": {
            "rules": [
                {
                    "test": {},
                    "resolve": {
                        "fullySpecified": false
                    }
                },
                {
                    "test": {},
                    "exclude": [
                        {}
                    ],
                    "use": [
                        {
                            "loader": "babel-loader",
                            "options": {
                                "plugins": [
                                    "@babel/plugin-proposal-class-properties"
                                ],
                                "presets": [
                                    [
                                        "@babel/preset-env",
                                        {
                                            "corejs": 3,
                                            "modules": "cjs",
                                            "targets": {
                                                "chrome": 72,
                                                "edge": 17,
                                                "firefox": 60,
                                                "safari": 13
                                            },
                                            "useBuiltIns": "usage"
                                        }
                                    ],
                                    [
                                        "@babel/preset-react",
                                        {
                                            "runtime": "automatic"
                                        }
                                    ]
                                ]
                            }
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "style-loader"
                        },
                        {
                            "loader": "css-loader"
                        },
                        {
                            "loader": "less-loader"
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "style-loader"
                        },
                        {
                            "loader": "css-loader"
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "file-loader"
                        }
                    ]
                }
            ]
        },
        "resolve": {
            "extensions": [
                ".js",
                ".jsx",
                ".json"
            ]
        },
        "mode": "development",
        "optimization": {
            "minimize": false,
            "chunkIds": "named",
            "runtimeChunk": "single",
            "splitChunks": {
                "chunks": "all",
                "maxInitialRequests": 30,
                "maxAsyncRequests": 30
            }
        },
        "parallelism": 4,
        "plugins": [
            {
                "profile": false,
                "modulesCount": 5000,
                "dependenciesCount": 10000,
                "showEntries": true,
                "showModules": true,
                "showDependencies": true,
                "showActiveModules": false
            },
            {
                "dangerouslyAllowCleanPatternsOutsideProject": false,
                "dry": false,
                "verbose": false,
                "cleanStaleWebpackAssets": true,
                "protectWebpackAssets": true,
                "cleanAfterEveryBuildPatterns": [],
                "cleanOnceBeforeBuildPatterns": [
                    "**/*"
                ],
                "currentAssets": [],
                "initialClean": false,
                "outputPath": ""
            },
            {
                "options": {
                    "filename": "views/assets/webpack-assets.json",
                    "prettyPrint": true,
                    "update": false,
                    "fullPath": true,
                    "manifestFirst": true,
                    "useCompilerPath": false,
                    "fileTypes": [
                        "js",
                        "css"
                    ],
                    "includeAllFileTypes": true,
                    "includeFilesWithoutChunk": false,
                    "includeAuxiliaryAssets": false,
                    "keepInMemory": false,
                    "integrity": false,
                    "removeFullPathAutoPrefix": false,
                    "entrypoints": true
                }
            }
        ],
        "devtool": "source-map",
        "target": "web",
        "watch": true,
        "entry": {
            "join": "./src/apps/join.js",
            "signin": "./src/apps/signin.js",
            "reset-password": "./src/apps/reset-password.js"
        },
        "output": {
            "path": "/Users/dlj/projects/myapp/web/public/js/",
            "publicPath": "/js/",
            "filename": "[name].[contenthash].js"
        }
    },
    "/public/apps/": {
        "cache": {
            "type": "filesystem"
        },
        "module": {
            "rules": [
                {
                    "test": {},
                    "resolve": {
                        "fullySpecified": false
                    }
                },
                {
                    "test": {},
                    "exclude": [
                        {}
                    ],
                    "use": [
                        {
                            "loader": "babel-loader",
                            "options": {
                                "plugins": [
                                    "@babel/plugin-proposal-class-properties"
                                ],
                                "presets": [
                                    [
                                        "@babel/preset-env",
                                        {
                                            "corejs": 3,
                                            "modules": "cjs",
                                            "targets": {
                                                "chrome": 72,
                                                "edge": 17,
                                                "firefox": 60,
                                                "safari": 13
                                            },
                                            "useBuiltIns": "usage"
                                        }
                                    ],
                                    [
                                        "@babel/preset-react",
                                        {
                                            "runtime": "automatic"
                                        }
                                    ]
                                ]
                            }
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "style-loader"
                        },
                        {
                            "loader": "css-loader"
                        },
                        {
                            "loader": "less-loader"
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "style-loader"
                        },
                        {
                            "loader": "css-loader"
                        }
                    ]
                },
                {
                    "test": {},
                    "use": [
                        {
                            "loader": "file-loader"
                        }
                    ]
                }
            ]
        },
        "resolve": {
            "extensions": [
                ".js",
                ".jsx",
                ".json"
            ]
        },
        "mode": "development",
        "optimization": {
            "minimize": false,
            "chunkIds": "named",
            "runtimeChunk": "single",
            "splitChunks": {
                "chunks": "all",
                "maxInitialRequests": 30,
                "maxAsyncRequests": 30
            }
        },
        "parallelism": 4,
        "plugins": [
            {
                "profile": false,
                "modulesCount": 5000,
                "dependenciesCount": 10000,
                "showEntries": true,
                "showModules": true,
                "showDependencies": true,
                "showActiveModules": false
            },
            {
                "dangerouslyAllowCleanPatternsOutsideProject": false,
                "dry": false,
                "verbose": false,
                "cleanStaleWebpackAssets": true,
                "protectWebpackAssets": true,
                "cleanAfterEveryBuildPatterns": [],
                "cleanOnceBeforeBuildPatterns": [
                    "**/*"
                ],
                "currentAssets": [],
                "initialClean": false,
                "outputPath": ""
            },
            {
                "options": {
                    "filename": "views/assets/webpack-assets.json",
                    "prettyPrint": true,
                    "update": false,
                    "fullPath": true,
                    "manifestFirst": true,
                    "useCompilerPath": false,
                    "fileTypes": [
                        "js",
                        "css"
                    ],
                    "includeAllFileTypes": true,
                    "includeFilesWithoutChunk": false,
                    "includeAuxiliaryAssets": false,
                    "keepInMemory": false,
                    "integrity": false,
                    "removeFullPathAutoPrefix": false,
                    "entrypoints": true
                }
            }
        ],
        "devtool": "source-map",
        "target": "web",
        "watch": true,
        "entry": {
            "queues": "./src/apps/queues/app.jsx",
            "sources": "./src/apps/sources/app.jsx",
            "settings": "./src/apps/settings/app.jsx"
        },
        "output": {
            "path": "/Users/dlj/projects/myapp/web/public/apps/",
            "publicPath": "/apps/",
            "filename": "[name].[contenthash].js"
        }
    }
}