title: How do I exclude a file (eg config file) in Vue.js?
body: <ul>
  <li><a href="https://cli.vuejs.org/config/#configurewebpack" rel="noreferrer">https://cli.vuejs.org/config/#configurewebpack</a></li>
  <li><a href="https://cli.vuejs.org/config/#chainwebpack" rel="noreferrer">https://cli.vuejs.org/config/#chainwebpack</a></li>
  </ul>
  
  <p>I've tried:</p>
  
  <pre><code>chainWebpack: config =&gt; {
      config.merge({
          module: {
              rules: [{
                  test: /\.jsx?$/,
                  exclude: {
                      exclude: [path.resolve(__dirname, "public/my-config.js")]
                  }
              }]
          }
      })
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>config.module.rule('js')
    .exclude({
      exclude: path.resolve(__dirname, "public/my-config.js")
    })
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>I want to either import <code>public/my-config.js</code> with script tag in the <code>pages/index.html</code> or just <code>import { config1, config2 } from '../public/my-config'</code>.</p>
  
  <p>I was able to use <code>externals</code> to not include a module in webpack though, but it's not quite intuitive with Vue.js.</p>
  
  <p>I must have the <code>my-config.js</code> be available at <code>dist/</code> so that it can be edited.</p>