-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Duplicated imported code #15
Comments
cssnext "just" inline import statement, so it's a normal behavior. The problem is, if we handle the imports in a different way (via webpack instead of inlining), we might loose some variables definition for example. (For my concern, I don't really use imports when using cssnext-loader. I have some global variables defined in cssnext configuration & that's enough for my needs.) I am open to the discussion & pull requests but that is not easy to "fix". |
What do you exactly mean by:
How is this done? |
http://cssnext.io/usage/#features in webpack config module.exports = {
entry: "path/to/entry",
// ...
cssnext: {
features: {
customProperties: {
variables: {mainColor: "#f00"}
}
}
}
} |
Gotcha, yeah, I was looking at the |
Is it possible to declare custom media query extensions this way as well? The customProperties object works perfectly, but defining the customMedia object to work the same way as the postcss test fixture doesn't work :( // ...
cssnext: {
browsers: "last 2 versions",
features: {
customProperties: {
variables: {
'main-color': "#f00"
}
},
customMedia: {
extensions: {
'viewport-testing': '(min-width: 500px)'
},
appendExtensions: true
}
}
}
// ... EDIT: I see the problem, if I set the key as |
yes it seems this should works. I guess tests are wrong :/ I opened an issue for that csstools/postcss-custom-media#11 |
It seems that if you import the same file from multiple files it ends up beeing duplicated in the final bundle. Is this a known issue?
It seems that the sass-loader also had this problem (webpack-contrib/sass-loader#30) and resolved it here: webpack-contrib/sass-loader#31
The text was updated successfully, but these errors were encountered: