-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude modules dictionary #915
Comments
Please provide minimum reproducible test repo. Looks you use |
It is already doesn't adding if no locals https://github.com/webpack-contrib/css-loader/blob/master/src/index.js#L325 |
|
I can't understand problem |
Sorry for not providing minimal repo, here you go. |
Invalid configuration as i written in |
So how do I remove the dictionary function(e,t,n){e.exports={"my-icon-times":"Pref-my-icon-times-sufX","my-icon-chevron":"Pref-my-icon-chevron-sufX","my-icon-paperclip":"Pref-my-icon-paperclip-sufX","my-icon-caret":"Pref-my-icon-caret-sufX","my-icon-comments":"Pref-my-icon-comments-sufX","my-icon-smile":"Pref-my-icon-smile-sufX"}}]).default} from the bundle in the file build/main.js Is there any option to turn including off? |
modules false |
In case someone would stumble with the same question, {test: /\.(c|sc|sa|le)ss$/, use: [
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: [
require('postcss-modules')({
getJSON: () => {}, // do not create mapping json
generateScopedName: 'prefix-[local]-suffix'
})
]
},
},
]}, |
Expected Behavior
Exclude modules dictionary from the bundle, if styles are imported without specifying variable for the dictionary, like so:
import './style/index.scss';
And include dictionary to the bundle with
import dict from './style/index.scss';
Actual Behavior
The dictionary gets included in the bundle either way.
Why it is needed:
localIdentName
is generatedThe tree shaking, obviously, does not work.
Also the loader option could be specified, not to include the dictionary in the bundle output.
Another issue:
Also I was trying to see, if
exportOnlyLocals: true,
has any effect on bundle generation, but ithas exited with error code
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
Code
How Do We Reproduce?
The text was updated successfully, but these errors were encountered: