title: Can i have a single variables file using cssnext with webpack?
body: <p>I've got a project which has a set of css files (one for each react component). I'm using the css-loader (with modules on) in webpack and also postcss-cssnext.</p>
  
  <p>Ideally i want a single <code>variables.css</code> so i can share variables across the css files. I've tried having <code>variables.css</code> containing something like:</p>
  
  <pre><code>:root {
    --gutter-width: 1rem;
    --outer-margin: 2rem;
    ...
  }
  </code></pre>
  
  <p>which i then import so it goes through the css loader. The problem is, other files don't pick up on these variables, so either this doesn't work or i'm doing something wrong (including this in the component css file directly does work).</p>
  
  <p>One thing that does work is having a <code>styles.json</code> file with the following webpack setup:</p>
  
  <pre><code>postcss: function (webpack) {
      return [
          ...
          require("postcss-cssnext")({
            features: {
              customProperties: {
                variables: require('./src/styles.json')
              }
            }
          })
          ...
      ]
  }
  </code></pre>
  
  <p>The main problem with this though is every time i change a variable i have to restart the webpack dev server (so reloading the webpack config). This isn't ideal.</p>
  
  <p>So, any thoughts on a better way to do this?</p>