Skip to content

Commit a753173

Browse files
Merge pull request #1 from webpack-config/name-option
Allow customization of output filename.
2 parents 40b32e5 + 77a153a commit a753173

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/postcss.webpack.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ const loaders = ({target, external, minimize, loader}) => {
5252
return `${pack(cssLocals, config)}!${loader}`;
5353
};
5454

55-
export default (options = []) => (config) => {
55+
export default ({
56+
options = [],
57+
filename = '[name].css',
58+
} = {}) => (config) => {
5659
const {target} = config;
5760
const env = process.env.NODE_ENV || 'development';
5861
const hot = process.env.HOT || false;
@@ -126,8 +129,7 @@ export default (options = []) => (config) => {
126129
// Some crawlers or things with Javascript disabled prefer normal CSS
127130
// instead of Javascript injected CSS, so this plugin allows for the
128131
// collection of the generated CSS into its own file.
129-
// .[contenthash]
130-
new ExtractTextPlugin('[name].css'),
132+
new ExtractTextPlugin(filename),
131133
] : []),
132134
],
133135
});

0 commit comments

Comments
 (0)