Skip to content

Commit

Permalink
archetype-react-app-dev: fix CSS modules class name (#258)
Browse files Browse the repository at this point in the history
* Fix CSS modules class name

Closes #190

* Fix long line length error
  • Loading branch information
karlhorky authored and jchip committed Mar 31, 2017
1 parent f28fe85 commit b72d207
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ const cssModuleSupport = stylusExists && !cssNextExists;
module.exports = function () {
const cssModuleStylusSupport = archetype.webpack.cssModuleStylusSupport;
const stylusQuery = cssLoader + "?-autoprefixer!" + stylusLoader;
const cssQuery = cssLoader + "?modules&-autoprefixer!" + postcssLoader;
const cssStylusQuery = cssLoader + "?modules&-autoprefixer!" + postcssLoader + "!" + stylusLoader;
const cssLoaderOptions = "?modules&localIdentName=[name]__[local]___[hash:base64:5]&-autoprefixer";
const cssQuery = cssLoader + cssLoaderOptions + "!" + postcssLoader;
const cssStylusQuery = cssLoader + cssLoaderOptions + "!" + postcssLoader + "!" + stylusLoader;

// By default, this archetype assumes you are using CSS-Modules + CSS-Next
const rules = [{
Expand Down Expand Up @@ -92,6 +93,7 @@ module.exports = function () {
new CSSSplitPlugin({ size: 4000, imports: true, preserve: true }),
new webpack.LoaderOptionsPlugin({
options: {
context: Path.resolve(process.cwd(), "client"),
postcss: () => {
return cssModuleSupport ? [atImport, cssnext({
browsers: ["last 2 versions", "ie >= 9", "> 5%"]
Expand Down

0 comments on commit b72d207

Please sign in to comment.