@@ -580,7 +580,7 @@ module.exports = {
580
580
mode: " local" ,
581
581
auto: true ,
582
582
exportGlobals: true ,
583
- localIdentName: " [path][name]__[local]--[hash:base64:5 ]" ,
583
+ localIdentName: " [path][name]__[local]--[contenthash ]" ,
584
584
localIdentContext: path .resolve (__dirname , " src" ),
585
585
localIdentHashPrefix: " my-custom-hash" ,
586
586
namedExport: true ,
@@ -754,15 +754,31 @@ module.exports = {
754
754
##### ` localIdentName `
755
755
756
756
Type: ` String `
757
- Default: ` '[hash:base64 ]' `
757
+ Default: ` '[contenthash ]' `
758
758
759
759
Allows to configure the generated local ident name.
760
- See [ loader-utils's documentation] ( https://github.com/webpack/loader-utils#interpolatename ) for more information on options.
760
+
761
+ For more information on options see:
762
+
763
+ - [ webpack template strings] ( https://webpack.js.org/configuration/output/#template-strings ) ,
764
+ - [ output.hashdigest] ( https://webpack.js.org/configuration/output/#outputhashdigest ) ,
765
+ - [ output.hashDigestLength] ( https://webpack.js.org/configuration/output/#outputhashdigestlength ) ,
766
+ - [ output.hashFunction] ( https://webpack.js.org/configuration/output/#outputhashfunction ) ,
767
+ - [ output.hashSalt] ( https://webpack.js.org/configuration/output/#outputhashsalt ) .
768
+
769
+ Supported template strings:
770
+
771
+ - [ name] the basename of the resource
772
+ - [ path] the path of the resource relative to the ` compiler.context ` option or ` modules.localIdentContext ` option.
773
+ - [ file] - filename and path.
774
+ - [ ext] - extension with leading .
775
+ - [ contenthash] - the hash of the string, generated based on ` hashPrefix ` , ` localIdentContext ` , ` resourcePath ` and ` exportName `
776
+ - [ local] - original class.
761
777
762
778
Recommendations:
763
779
764
- - use ` '[path][name ]__[local]' ` for development
765
- - use ` '[hash:base64 ]' ` for production
780
+ - use ` '[file ]__[local]' ` for development
781
+ - use ` '[contenthash ]' ` for production
766
782
767
783
The ` [local] ` placeholder contains original class.
768
784
@@ -779,7 +795,7 @@ module.exports = {
779
795
loader: " css-loader" ,
780
796
options: {
781
797
modules: {
782
- localIdentName: " [path][name]__[local]--[hash:base64:5 ]" ,
798
+ localIdentName: " [path][name]__[local]--[contenthash ]" ,
783
799
},
784
800
},
785
801
},
0 commit comments